@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | public static function validate($cep) |
| 24 | 24 | { |
| 25 | - if (preg_match('/[0-9]{2,2}([.]?)[0-9]{3,3}([- ]?)[0-9]{3}$/', $cep) == 0 ) { |
|
| 25 | + if (preg_match('/[0-9]{2,2}([.]?)[0-9]{3,3}([- ]?)[0-9]{3}$/', $cep) == 0) { |
|
| 26 | 26 | return false; |
| 27 | 27 | } |
| 28 | 28 | try { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public static function isSame(string $to, string $from) |
| 46 | 46 | { |
| 47 | - return (self::toDatabase($to)===self::toDatabase($from)); |
|
| 47 | + return (self::toDatabase($to) === self::toDatabase($from)); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | } |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | public static function validate($birthdate) |
| 18 | 18 | { |
| 19 | - if (!parent::validate($birthdate)){ |
|
| 19 | + if (!parent::validate($birthdate)) { |
|
| 20 | 20 | return false; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $birthdate = Carbon::createFromFormat('Y-m-d', self::toDatabase($birthdate)); |
| 24 | - if ($birthdate->greaterThan(Carbon::now())){ |
|
| 24 | + if ($birthdate->greaterThan(Carbon::now())) { |
|
| 25 | 25 | return false; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public static function isSame(string $to, string $from) |
| 32 | 32 | { |
| 33 | - return (self::toDatabase($to)===self::toDatabase($from)); |
|
| 33 | + return (self::toDatabase($to) === self::toDatabase($from)); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | } |
@@ -50,9 +50,9 @@ |
||
| 50 | 50 | ) |
| 51 | 51 | ) { |
| 52 | 52 | return false; |
| 53 | - } |
|
| 54 | - // Calcula os digitos verificadores para verificar se o |
|
| 55 | - // CPF é válido |
|
| 53 | + } |
|
| 54 | + // Calcula os digitos verificadores para verificar se o |
|
| 55 | + // CPF é válido |
|
| 56 | 56 | for ($t = 9; $t < 11; $t++) { |
| 57 | 57 | |
| 58 | 58 | for ($d = 0, $c = 0; $c < $t; $c++) { |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | // Calcula os digitos verificadores para verificar se o |
| 55 | 55 | // CPF é válido |
| 56 | - for ($t = 9; $t < 11; $t++) { |
|
| 56 | + for ($t = 9; $t<11; $t++) { |
|
| 57 | 57 | |
| 58 | - for ($d = 0, $c = 0; $c < $t; $c++) { |
|
| 59 | - $d += $cpf{$c} * (($t + 1) - $c); |
|
| 58 | + for ($d = 0, $c = 0; $c<$t; $c++) { |
|
| 59 | + $d += $cpf{$c} * (($t+1)-$c); |
|
| 60 | 60 | } |
| 61 | 61 | $d = ((10 * $d) % 11) % 10; |
| 62 | 62 | if ($cpf{$c} != $d) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public static function isSame(string $to, string $from) |
| 71 | 71 | { |
| 72 | - return (self::toDatabase($to)===self::toDatabase($from)); |
|
| 72 | + return (self::toDatabase($to) === self::toDatabase($from)); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | } |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | public static function validate($creditCardNumber) |
| 23 | 23 | { |
| 24 | 24 | $found = false; |
| 25 | - foreach (self::$cardParams as $masks){ |
|
| 26 | - foreach ($masks as $mask){ |
|
| 27 | - if (self::maskIsValidate($creditCardNumber, $mask)){ |
|
| 25 | + foreach (self::$cardParams as $masks) { |
|
| 26 | + foreach ($masks as $mask) { |
|
| 27 | + if (self::maskIsValidate($creditCardNumber, $mask)) { |
|
| 28 | 28 | $found = true; |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public static function expirationIsValid($mes, $ano) |
| 36 | 36 | { |
| 37 | - if ((int) Date::yearToDatabase($ano) < (int) Carbon::now()->year) { |
|
| 37 | + if ((int) Date::yearToDatabase($ano)<(int) Carbon::now()->year) { |
|
| 38 | 38 | return false; |
| 39 | 39 | } |
| 40 | 40 | if ((int) Date::yearToDatabase($ano) == (int) Carbon::now()->year) { |
| 41 | - if ((int) Date::monthToDatabase($mes) < (int) Carbon::now()->month) { |
|
| 41 | + if ((int) Date::monthToDatabase($mes)<(int) Carbon::now()->month) { |
|
| 42 | 42 | return false; |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public static function isSame(string $to, string $from) |
| 59 | 59 | { |
| 60 | - return (self::toDatabase($to)===self::toDatabase($from)); |
|
| 60 | + return (self::toDatabase($to) === self::toDatabase($from)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | } |