@@ -22,8 +22,8 @@ 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){ |
|
25 | + foreach (self::$cardParams as $masks) { |
|
26 | + foreach ($masks as $mask) { |
|
27 | 27 | if (self::maskIsValidate($creditCardNumber, $mask)) { |
28 | 28 | $found = true; |
29 | 29 | } |
@@ -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 | } |
@@ -16,13 +16,13 @@ |
||
16 | 16 | if ($maskLen !== $numberLen) { |
17 | 17 | return false; |
18 | 18 | } |
19 | - while($i < $maskLen) { |
|
20 | - if (strtoupper($mask[$i])!=='X' && strtoupper($mask[$i])!=='#') { |
|
21 | - if ($mask[$i]!==$number[$i]) { |
|
19 | + while ($i<$maskLen) { |
|
20 | + if (strtoupper($mask[$i]) !== 'X' && strtoupper($mask[$i]) !== '#') { |
|
21 | + if ($mask[$i] !== $number[$i]) { |
|
22 | 22 | return false; |
23 | 23 | } |
24 | 24 | } |
25 | - $i = $i + 1; |
|
25 | + $i = $i+1; |
|
26 | 26 | } |
27 | 27 | return true; |
28 | 28 | } |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | { |
11 | 11 | $data = explode('/', $dataOriginal); |
12 | 12 | if (isset($data[2])) { |
13 | - if($data[1]>12) { |
|
14 | - return $data[2] .'-'. $data[0] .'-'. $data[1]; |
|
13 | + if ($data[1]>12) { |
|
14 | + return $data[2].'-'.$data[0].'-'.$data[1]; |
|
15 | 15 | } |
16 | - return $data[2] .'-'. $data[1] .'-'. $data[0]; |
|
16 | + return $data[2].'-'.$data[1].'-'.$data[0]; |
|
17 | 17 | } |
18 | 18 | return $dataOriginal; |
19 | 19 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | public static function isSame(string $to, string $from) |
74 | 74 | { |
75 | - return (self::toDatabase($to)===self::toDatabase($from)); |
|
75 | + return (self::toDatabase($to) === self::toDatabase($from)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | } |
@@ -8,10 +8,10 @@ discard block |
||
8 | 8 | public static function toDatabase(string $phone) |
9 | 9 | { |
10 | 10 | $phone = preg_replace('/[^0-9]/', '', $phone); |
11 | - if (substr((string) $phone, 0, 2)=='55') { |
|
11 | + if (substr((string) $phone, 0, 2) == '55') { |
|
12 | 12 | return $phone; |
13 | 13 | } |
14 | - if (empty($phone) || $phone=='55') { |
|
14 | + if (empty($phone) || $phone == '55') { |
|
15 | 15 | return null; |
16 | 16 | } |
17 | 17 | if (strlen($phone)>11) { |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | { |
30 | 30 | $phone = self::break($phoneNumber); |
31 | 31 | |
32 | - if ((int) $phone['country'] === 0 ) { |
|
32 | + if ((int) $phone['country'] === 0) { |
|
33 | 33 | return false; |
34 | 34 | } |
35 | 35 | |
36 | - if ((int) $phone['region'] === 0 ) { |
|
36 | + if ((int) $phone['region'] === 0) { |
|
37 | 37 | return false; |
38 | 38 | } |
39 | 39 | |
40 | - if ((int) $phone['number'] === 0 ) { |
|
40 | + if ((int) $phone['number'] === 0) { |
|
41 | 41 | return false; |
42 | 42 | } |
43 | 43 | |
44 | - if (strlen(static::toDatabase($phoneNumber)) < 12 || strlen(static::toDatabase($phoneNumber)) > 13) { |
|
44 | + if (strlen(static::toDatabase($phoneNumber))<12 || strlen(static::toDatabase($phoneNumber))>13) { |
|
45 | 45 | return false; |
46 | 46 | } |
47 | 47 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | public static function isSame(string $to, string $from) |
72 | 72 | { |
73 | - return (self::toDatabase($to)===self::toDatabase($from)); |
|
73 | + return (self::toDatabase($to) === self::toDatabase($from)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | } |