-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove header copyright information.
- Loading branch information
Showing
3 changed files
with
13 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,6 @@ | |
|
||
namespace Ofcold\IdentityCard; | ||
|
||
/** | ||
* class IdentityCard | ||
* | ||
* PHP business application development core system | ||
* | ||
* This content is released under the Business System Toll License (MST) | ||
* | ||
* @link https://ofcold.com | ||
* | ||
* @author Bill Li ([email protected]) [Owner] | ||
* | ||
* @copyright Copyright (c) 2017-2019 Bill Li, Ofcold Institute of Technology. All rights reserved. | ||
*/ | ||
class IdentityCard | ||
{ | ||
/** | ||
|
@@ -44,7 +31,7 @@ class IdentityCard | |
* @param string $idCard | ||
* @param string $locale | ||
* | ||
* @return $this | ||
* @return $this|boolean | ||
*/ | ||
public static function make(string $idCard, string $locale = 'zh-cn') | ||
{ | ||
|
@@ -64,7 +51,7 @@ public static function make(string $idCard, string $locale = 'zh-cn') | |
* | ||
* @return string | ||
*/ | ||
public static function getLocale() : string | ||
public static function getLocale(): string | ||
{ | ||
return static::$locale ?: 'zh-cn'; | ||
} | ||
|
@@ -74,7 +61,7 @@ public static function getLocale() : string | |
* | ||
* @return bool | ||
*/ | ||
protected static function check() : bool | ||
protected static function check(): bool | ||
{ | ||
$id = strtoupper(static::$idCard); | ||
|
||
|
@@ -97,7 +84,7 @@ protected static function check() : bool | |
* | ||
* @return bool | ||
*/ | ||
protected static function checkFirst(string $idCard) : bool | ||
protected static function checkFirst(string $idCard): bool | ||
{ | ||
return preg_match('/^\d{6}(18|19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/', $idCard); | ||
} | ||
|
@@ -109,7 +96,7 @@ protected static function checkFirst(string $idCard) : bool | |
* | ||
* @return string | ||
*/ | ||
protected static function getIDCardVerifyNumber(string $idcardBase) : string | ||
protected static function getIDCardVerifyNumber(string $idcardBase): string | ||
{ | ||
$factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; | ||
|
||
|
@@ -205,7 +192,7 @@ protected function __construct() | |
* | ||
* @return string | ||
*/ | ||
public function getArea() | ||
public function getArea(): string | ||
{ | ||
return "{$this->getProvince()} {$this->getCity()} {$this->getCounty()}"; | ||
} | ||
|
@@ -247,7 +234,7 @@ public function getCity(): ?string | |
* | ||
* @return string|null | ||
*/ | ||
public function getCounty() : ?string | ||
public function getCounty(): ?string | ||
{ | ||
$k = substr(static::$idCard, 0, 6); | ||
|
||
|
@@ -263,7 +250,7 @@ public function getCounty() : ?string | |
* | ||
* @return string | ||
*/ | ||
public function getGender() : string | ||
public function getGender(): string | ||
{ | ||
$loale = [ | ||
'zh-cn' => ['female' => '女', 'male' => '男'], | ||
|
@@ -280,7 +267,7 @@ public function getGender() : string | |
* | ||
* @return string | ||
*/ | ||
public function getBirthday(string $format = 'Y-m-d') : string | ||
public function getBirthday(string $format = 'Y-m-d'): string | ||
{ | ||
return date( | ||
$format, | ||
|
@@ -354,7 +341,7 @@ public function getConstellation(): string | |
* | ||
* @return string | ||
*/ | ||
public function toJson(int $options = 0) : string | ||
public function toJson(int $options = 0): string | ||
{ | ||
return json_encode($this->toArray(), $options); | ||
} | ||
|
@@ -364,7 +351,7 @@ public function toJson(int $options = 0) : string | |
* | ||
* @return array | ||
*/ | ||
public function toArray() : array | ||
public function toArray(): array | ||
{ | ||
return [ | ||
'area' => $this->getArea(), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,6 @@ | |
|
||
namespace Ofcold\IdentityCard; | ||
|
||
/** | ||
* class RegionsData | ||
* | ||
* People's Republic of China provincial administrative divisions code (excluding Hong Kong, Macao and Taiwan regions). | ||
* | ||
* PHP business application development core system | ||
* | ||
* This content is released under the Business System Toll License (MST) | ||
* | ||
* @link https://ofcold.com | ||
* | ||
* @author Bill Li ([email protected]) [Owner] | ||
* | ||
* @copyright Copyright (c) 2017-2019 Bill Li, Ofcold Institute of Technology. All rights reserved. | ||
*/ | ||
class RegionsData | ||
{ | ||
public static function items() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,10 @@ | |
|
||
namespace Ofcold\IdentityCard\Rules; | ||
|
||
use Illuminate\Contracts\Validation\Rule; | ||
use Illuminate\Contracts\Validation\Rule as RuleInterface; | ||
use Ofcold\IdentityCard\IdentityCard; | ||
|
||
/** | ||
* class IdCard | ||
* | ||
* PHP business application development core system | ||
* | ||
* This content is released under the Business System Toll License (MST) | ||
* | ||
* @link https://ofcold.com | ||
* | ||
* @author Bill Li ([email protected]) [Owner] | ||
* | ||
* @copyright Copyright (c) 2017-2019 Bill Li, Ofcold Institute of Technology. All rights reserved. | ||
*/ | ||
class IdCard implements Rule | ||
class IdCard implements RuleInterface | ||
{ | ||
/** | ||
* Determine if the validation rule passes. | ||
|