Skip to content

Commit

Permalink
add zodiac by user information.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill li committed Nov 28, 2017
1 parent 179c6b0 commit 7953974
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/IdentityCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -24896,6 +24896,16 @@ public function getAge() : int
return (int) strtotime(substr(static::$idCard,6,8).' +'.$diff.'years') > $today ? ($diff + 1) : $diff;
}

/**
* Return user zodiac.
*
* @return string
*/
public function getZodiac() : string
{
return ['', '', '', '', '', '', '', '', '', '', '', ''][abs(substr(static::$idCard, 10, 2) - 1901) % 12];
}

/**
* Get constellation.
*
Expand Down

0 comments on commit 7953974

Please sign in to comment.