Skip to content

Commit

Permalink
Merge branch 'hotfix/v1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy IIIFX Khomenko committed Dec 4, 2016
2 parents a59a6a6 + 6c6d4dd commit 1dd14c5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ public function setPersonBirthDatetime ( DateTimeInterface $datetime )
}

/**
* Format: DDDDDXXXSC
* Format: {DDDDD}{RRR}{S}{C}
*
* DDDDD - Days from 1900-01-01
* XXX - Any nambers
* S - Person sex
* C - Control digit
* {DDDDD} - Days from 1900-01-01
* {RRR} - Any nambers
* {S} - Person sex
* {C} - Control digit
*
* @return string
*/
Expand All @@ -143,7 +143,7 @@ public function createNumber ()
$days = mt_rand( 0, $max );
}
$DDDDD = sprintf( '%1$05d', $days + 2 );
$XXX = sprintf( '%1$03d', mt_rand( 0, 999 ) );
$RRR = sprintf( '%1$03d', mt_rand( 0, 999 ) );
if ( !( $sex = $this->personSex ) ) {
$list = [ static::SEX_MALE => 0, static::SEX_FEMALE => 0 ];
$sex = array_rand( $list );
Expand All @@ -154,7 +154,7 @@ public function createNumber ()
$list = [ 1 => 0, 3 => 0, 5 => 0, 7 => 0, 9 => 0 ];
}
$S = array_rand( $list );
$number = "{$DDDDD}{$XXX}{$S}";
$number = "{$DDDDD}{$RRR}{$S}";
$summ =
( $number{0} * -1 ) +
( $number{1} * 5 ) +
Expand Down

0 comments on commit 1dd14c5

Please sign in to comment.