From 4cf4d7416f8c718aff0756ba1cc4572573033c1f Mon Sep 17 00:00:00 2001 From: Bill li Date: Tue, 14 May 2019 15:44:58 +0800 Subject: [PATCH] Remove header copyright information. --- src/IdentityCard.php | 35 +++++++++++------------------------ src/RegionsData.php | 15 --------------- src/Rules/IdCard.php | 17 ++--------------- 3 files changed, 13 insertions(+), 54 deletions(-) diff --git a/src/IdentityCard.php b/src/IdentityCard.php index 7cb1146..4f5df48 100644 --- a/src/IdentityCard.php +++ b/src/IdentityCard.php @@ -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 (bill.li@ofcold.com) [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(), diff --git a/src/RegionsData.php b/src/RegionsData.php index 3ee2943..167c11f 100644 --- a/src/RegionsData.php +++ b/src/RegionsData.php @@ -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 (bill.li@ofcold.com) [Owner] - * - * @copyright Copyright (c) 2017-2019 Bill Li, Ofcold Institute of Technology. All rights reserved. - */ class RegionsData { public static function items() diff --git a/src/Rules/IdCard.php b/src/Rules/IdCard.php index 188afcd..d06867a 100644 --- a/src/Rules/IdCard.php +++ b/src/Rules/IdCard.php @@ -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 (bill.li@ofcold.com) [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.