File tree Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 11<?php
22
33namespace Jxlwqq \IdValidator ;
4+
45/**
5- * Trait Checker
6+ * Trait Checker.
67 */
78trait Checker
89{
9-
1010 /**
1111 * 检查并拆分身份证号.
1212 *
Original file line number Diff line number Diff line change 33namespace Jxlwqq \IdValidator ;
44
55/**
6- * Trait Generator
6+ * Trait Generator.
77 */
88trait Generator
99{
@@ -68,6 +68,7 @@ private function _generatorBirthdayCode($birthday)
6868 * 生成地址码
6969 *
7070 * @param string $address 地址(行政区全称)
71+ *
7172 * @return false|int|string
7273 */
7374 private function _generatorAddressCode ($ address )
@@ -126,7 +127,7 @@ private function _generatorCheckBit($body)
126127 for ($ i = 18 ; $ i > 1 ; $ i --) {
127128 $ weight = pow (2 , $ i - 1 ) % 11 ;
128129 $ posWeight [$ i ] = $ weight ;
129- };
130+ }
130131
131132 // 累身份证号 body 部分与位置加权的积
132133 $ bodySum = 0 ;
Original file line number Diff line number Diff line change 77 */
88trait Helper
99{
10-
11-
1210 /**
1311 * 获取地址码信息.
1412 *
@@ -25,7 +23,6 @@ private function _getAddressInfo($addressCode)
2523 $ provinceAddressCode = substr ($ addressCode , 0 , 2 ).'0000 ' ;
2624 $ addressInfo ['province ' ] = isset ($ this ->_addressCodeList [$ provinceAddressCode ]) ? $ this ->_addressCodeList [$ provinceAddressCode ] : (isset ($ this ->_abandonedAddressCodeList [$ provinceAddressCode ]) ? $ this ->_abandonedAddressCodeList [$ provinceAddressCode ] : '' );
2725
28-
2926 // 市级信息(港澳台居民居住证无市级信息)
3027 if ($ firstCharacter != '8 ' ) {
3128 $ cityAddressCode = substr ($ addressCode , 0 , 4 ).'00 ' ;
@@ -106,7 +103,6 @@ private function _getChineseZodiac($birthdayCode)
106103 return $ this ->_chineseZodiacList [$ key ];
107104 }
108105
109-
110106 /**
111107 * 生成随机数.
112108 *
@@ -123,10 +119,10 @@ private function _getRandInt($max, $min = 1)
123119 /**
124120 * 获取数字补位.
125121 *
126- * @param string|int $str 字符串
127- * @param int $len 长度
128- * @param string $chr 补位值
129- * @param bool $right 左右
122+ * @param string|int $str 字符串
123+ * @param int $len 长度
124+ * @param string $chr 补位值
125+ * @param bool $right 左右
130126 *
131127 * @return string
132128 */
Original file line number Diff line number Diff line change @@ -103,10 +103,10 @@ public function getInfo($id)
103103 /**
104104 * * 生成假数据.
105105 *
106- * @param bool $eighteen 是否为 18 位
107- * @param null|string $address 地址
108- * @param null|string|int $birthday 出生日期
109- * @param null|int $sex 性别(1为男性,0位女性)
106+ * @param bool $eighteen 是否为 18 位
107+ * @param null|string $address 地址
108+ * @param null|string|int $birthday 出生日期
109+ * @param null|int $sex 性别(1为男性,0位女性)
110110 *
111111 * @return string
112112 */
You can’t perform that action at this time.
0 commit comments