Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill li committed Apr 22, 2018
1 parent 182f8d0 commit 563bce8
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 57 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Anomaly
Copyright (c) 2017 Ofcold

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
</p>

<p align="center">
<img src="https://img.shields.io/github/issues/anomalylab/identity-card.svg">
<img src="https://img.shields.io/github/forks/anomalylab/identity-card.svg">
<img src="https://img.shields.io/github/stars/anomalylab/identity-card.svg">
<img src="https://img.shields.io/github/license/anomalylab/identity-card.svg">
<img src="https://img.shields.io/github/issues/ofcold/identity-card.svg">
<img src="https://img.shields.io/github/forks/ofcold/identity-card.svg">
<img src="https://img.shields.io/github/stars/ofcold/identity-card.svg">
<img src="https://img.shields.io/github/license/ofcold/identity-card.svg">
</p>

一个简单的身份证号码获取用户信息工具
Expand All @@ -20,7 +20,7 @@

```bash

composer require anomalylab/component-identity-card
composer require ofcold/component-identity-card
```


Expand All @@ -35,8 +35,8 @@
```php

try {
Anomaly\Component\IdentityCard\IdentityCard::make('32010619831029081');
Ofcold\Component\IdentityCard\IdentityCard::make('32010619831029081');

return true;
}
catch (\Exception $e)
Expand All @@ -56,9 +56,9 @@
```php

try {
$idCard = Anomaly\Component\IdentityCard\IdentityCard::make('320106198310290811');
$idCard = Ofcold\Component\IdentityCard\IdentityCard::make('320106198310290811');
// Use locale, Current supported zh-cn,en
// $idCard = Anomaly\Component\IdentityCard\IdentityCard::make('320106198310290811', 'zh-cn');
// $idCard = Ofcold\Component\IdentityCard\IdentityCard::make('320106198310290811', 'zh-cn');
$area = $idCard->getArea();
$gender = $idCard->getGender();
$birthday = $idCard->getBirthday();
Expand All @@ -68,7 +68,7 @@
catch (\Exception $e)
{
$e->getMessage();
}
}


```
Expand Down
10 changes: 5 additions & 5 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ China (region) citizen ID card tool

```bash

composer require anomalylab/component-identity-card
composer require ofcold/component-identity-card
```


Expand All @@ -23,7 +23,7 @@ A component based on People's Republic of China citizen ID card to obtain the us
```php

try {
$idCard = Anomaly\Component\IdentityCard\IdentityCard::make('32010619831029081');
$idCard = Ofcold\Component\IdentityCard\IdentityCard::make('32010619831029081');
print_r($idCard->toArray());
}
catch (\Exception $e)
Expand All @@ -43,9 +43,9 @@ A component based on People's Republic of China citizen ID card to obtain the us
```php

try {
$idCard = Anomaly\Component\IdentityCard\IdentityCard::make('320106198310290811', 'en');
$idCard = Ofcold\Component\IdentityCard\IdentityCard::make('320106198310290811', 'en');
// Use locale, Current supported zh-cn,en
// $idCard = Anomaly\Component\IdentityCard\IdentityCard::make('320106198310290811', 'zh-cn');
// $idCard = Ofcold\Component\IdentityCard\IdentityCard::make('320106198310290811', 'zh-cn');
$area = $idCard->getArea();
$gender = $idCard->getGender();
$birthday = $idCard->getBirthday();
Expand All @@ -56,7 +56,7 @@ A component based on People's Republic of China citizen ID card to obtain the us
{
$e->getMessage();
}



```
Expand Down
29 changes: 22 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "anomalylab/component-identity-card",
"name": "ofcold/component-identity-card",
"description": "A simple proof of identity card of the people's Republic of China.",
"keywords": [
"php71",
Expand All @@ -9,19 +9,34 @@
],
"type": "library",
"license": "MIT",
"homepage": "https://anomalylab.org",
"homepage": "https://ofcold.com",
"authors": [
{
"name": "Bill li",
"email": "[email protected]"
"name": "Ofcold Team",
"email": "[email protected]",
"homepage": "https://ofcold.com"
},
{
"name": "Olivia Fu",
"email": "[email protected]",
"homepage": "https://olivia.ink"
},
{
"name": "Bill Li",
"email": "[email protected]",
"homepage": "https://artisanbill.com"
}
],
"require": {
"php": ">=7.1"
"php": ">=7.1"
},
"autoload": {
"psr-4": {
"Anomaly\\Component\\IdentityCard\\": "src/"
"Ofcold\\IdentityCard\\": "src/"
}
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev"
}
19 changes: 0 additions & 19 deletions composer.lock

This file was deleted.

35 changes: 20 additions & 15 deletions src/IdentityCard.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<?php

namespace Anomaly\Component\IdentityCard;
namespace Ofcold\IdentityCard;


/**
* Class IdentityCard
* Class IdentityCard
*
* @link https://ofcold.ink
*
* @link https://anomalylab.org
* @author Anomaly lab, Inc <[email protected]>
* @author Bill Li <[email protected]>
* @author Ofcold, Inc <[email protected]>
* @author Olivia Fu <[email protected]>
* @author Bill Li <[email protected]>
*
* @package Ofcold\IdentityCard\IdentityCard
*/
class IdentityCard
{
Expand Down Expand Up @@ -59,15 +64,15 @@ public static function getLocale() : string
return static::$locale ?: 'zh-cn';
}

/**
/**
* Constellations(Data from Wikipedia https://zh.wikipedia.org/wiki/%E8%A5%BF%E6%B4%8B%E5%8D%A0%E6%98%9F%E8%A1%93)
*
*
* @var array
*/
protected $constellations = [
'zh-cn' => [
// 1.21-2.19 [Aquarius]
'水瓶座',
'水瓶座',
// 2.20-3.20 [Pisces]
'双鱼座',
// 3.21-4.19 [Aries]
Expand Down Expand Up @@ -109,7 +114,7 @@ public static function getLocale() : string

/**
* Constellation edge day cut data.
*
*
* @var array
*/
protected $constellationEdgeDays = [21, 20, 21, 20, 21, 22, 23, 23, 23, 24, 22, 21];
Expand Down Expand Up @@ -24815,7 +24820,7 @@ public function isCorrect() : bool
}

return false;

}

/**
Expand Down Expand Up @@ -24906,11 +24911,11 @@ public function getBirthday(string $format = 'Y-m-d') : string
return date(
$format,
mktime(
0,
0,
0,
substr(static::$idCard, 10, 2),
substr(static::$idCard, 12, 2),
0,
0,
0,
substr(static::$idCard, 10, 2),
substr(static::$idCard, 12, 2),
substr(static::$idCard, 6, 4))
);
}
Expand Down

0 comments on commit 563bce8

Please sign in to comment.