Skip to content

Commit 21cd13d

Browse files
committed
Apply fixes from StyleCI
1 parent 45d1b0a commit 21cd13d

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/Helper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,9 @@ private function _generatorAddressCode($address)
336336
private function _generatorBirthdayCode($birthday)
337337
{
338338
if ($birthday && is_numeric($birthday)) {
339-
$year = $this->_getStrPad(substr($birthday, 0,4), 4);
339+
$year = $this->_getStrPad(substr($birthday, 0, 4), 4);
340340
$month = $this->_getStrPad(substr($birthday, 4, 2), 2);
341341
$day = $this->_getStrPad(substr($birthday, 6, 2), 2);
342-
343342
}
344343
if (!isset($year) || empty($year) || $year < 1800 || $year > date('Y')) {
345344
$year = $this->_getStrPad($this->_generatorRandInt(99, 50), 2, '0');
@@ -373,11 +372,12 @@ private function _generatorOrderCode($sex)
373372
{
374373
$orderCode = $this->_getStrPad($this->_generatorRandInt(999, 1), 3, '1');
375374
if ($sex === 1) {
376-
$orderCode = $orderCode % 2 === 0 ? $orderCode -1 : $orderCode;
375+
$orderCode = $orderCode % 2 === 0 ? $orderCode - 1 : $orderCode;
377376
}
378377
if ($sex === 0) {
379-
$orderCode = $orderCode % 2 === 0 ? $orderCode : $orderCode -1;
378+
$orderCode = $orderCode % 2 === 0 ? $orderCode : $orderCode - 1;
380379
}
380+
381381
return $orderCode;
382382
}
383383
}

src/IdValidator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public function getInfo($id)
103103
/**
104104
* * 生成假数据.
105105
*
106-
* @param bool $eighteen 是否为 18 位
107-
* @param null|string|array $address 地址
108-
* @param null|string|int $sex 性别(1为男性,0位女性)
106+
* @param bool $eighteen 是否为 18 位
107+
* @param null|string|array $address 地址
108+
* @param null|string|int $sex 性别(1为男性,0位女性)
109109
* @param null|string|int|array $birthday 出生日期
110110
*
111111
* @return string
@@ -131,5 +131,4 @@ public function fakeId($eighteen = true, $address = null, $birthday = null, $sex
131131

132132
return $body.$checkBit;
133133
}
134-
135134
}

tests/IdValidatorTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ public function testFakeId()
2727
$this->assertEquals(true, $idValidator->isValid($idValidator->fakeId(true, '上海市', '2000', 1)));
2828
$this->assertEquals(true, $idValidator->isValid($idValidator->fakeId(true, '江苏省', '20000101', 1)));
2929
$this->assertEquals(true, $idValidator->isValid($idValidator->fakeId(true, '台湾省', '20131010', 0)));
30-
31-
3230
}
3331

3432
public function testGetInfo()

0 commit comments

Comments
 (0)