Skip to content

Commit

Permalink
Remove header copyright information.
Browse files Browse the repository at this point in the history
  • Loading branch information
lilianjin committed May 14, 2019
1 parent 3e40bbe commit 4cf4d74
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 54 deletions.
35 changes: 11 additions & 24 deletions src/IdentityCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down Expand Up @@ -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')
{
Expand All @@ -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';
}
Expand All @@ -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);

Expand All @@ -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);
}
Expand All @@ -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];

Expand Down Expand Up @@ -205,7 +192,7 @@ protected function __construct()
*
* @return string
*/
public function getArea()
public function getArea(): string
{
return "{$this->getProvince()} {$this->getCity()} {$this->getCounty()}";
}
Expand Down Expand Up @@ -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);

Expand All @@ -263,7 +250,7 @@ public function getCounty() : ?string
*
* @return string
*/
public function getGender() : string
public function getGender(): string
{
$loale = [
'zh-cn' => ['female' => '', 'male' => ''],
Expand All @@ -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,
Expand Down Expand Up @@ -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);
}
Expand All @@ -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(),
Expand Down
15 changes: 0 additions & 15 deletions src/RegionsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
17 changes: 2 additions & 15 deletions src/Rules/IdCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4cf4d74

Please sign in to comment.