@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function validate(string $attribute, mixed $value, Closure $fail): void |
19 | 19 | { |
20 | - if (! preg_match('/^#[^ !@#$%^&*(),.?":{}|<>]*$/', $value)) { |
|
20 | + if ( ! preg_match('/^#[^ !@#$%^&*(),.?":{}|<>]*$/', $value)) { |
|
21 | 21 | |
22 | 22 | $fail('validate.hashtag')->translate(); |
23 | 23 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function validate(string $attribute, mixed $value, Closure $fail): void |
19 | 19 | { |
20 | - if (! preg_match('/^[A-Z][a-z]+(?:[A-Z][a-z]+)*$/', $value)) { |
|
20 | + if ( ! preg_match('/^[A-Z][a-z]+(?:[A-Z][a-z]+)*$/', $value)) { |
|
21 | 21 | |
22 | 22 | $fail('validate.pascal-case')->translate(); |
23 | 23 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function validate(string $attribute, mixed $value, Closure $fail): void |
19 | 19 | { |
20 | - if (! preg_match('/^(?:[-A-Za-z0-9]+\.)+[A-Za-z]{2,6}$/', $value)) { |
|
20 | + if ( ! preg_match('/^(?:[-A-Za-z0-9]+\.)+[A-Za-z]{2,6}$/', $value)) { |
|
21 | 21 | |
22 | 22 | $fail('validate.domain')->translate(); |
23 | 23 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function validate(string $attribute, mixed $value, Closure $fail): void |
19 | 19 | { |
20 | - if (! preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $value)) { |
|
20 | + if ( ! preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $value)) { |
|
21 | 21 | |
22 | 22 | $fail('validate.slug')->translate(); |
23 | 23 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function validate(string $attribute, mixed $value, Closure $fail): void |
20 | 20 | { |
21 | - if (! $this->isJalaliDateValid($value)) { |
|
21 | + if ( ! $this->isJalaliDateValid($value)) { |
|
22 | 22 | |
23 | 23 | $fail('validate.jalali_date')->translate(); |
24 | 24 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | private function isJalaliDateValid(mixed $value): bool |
28 | 28 | { |
29 | - if (! is_string($value)) { |
|
29 | + if ( ! is_string($value)) { |
|
30 | 30 | return false; |
31 | 31 | } |
32 | 32 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function validate(string $attribute, mixed $value, Closure $fail): void |
19 | 19 | { |
20 | - if (! preg_match('/[A-Z]{2,}-\d+/', $value)) { |
|
20 | + if ( ! preg_match('/[A-Z]{2,}-\d+/', $value)) { |
|
21 | 21 | |
22 | 22 | $fail('validate.capital-char-with-number')->translate(); |
23 | 23 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function validate(string $attribute, mixed $value, Closure $fail): void |
19 | 19 | { |
20 | - if (! preg_match('/^\d*[13579]$/', $value)) { |
|
20 | + if ( ! preg_match('/^\d*[13579]$/', $value)) { |
|
21 | 21 | |
22 | 22 | $fail('validate.odd-number')->translate(); |
23 | 23 | } |
@@ -13,17 +13,17 @@ discard block |
||
13 | 13 | private function setCountries(?array $countries): void |
14 | 14 | { |
15 | 15 | if (empty($countries)) { |
16 | - $this->countries = []; |
|
16 | + $this->countries = [ ]; |
|
17 | 17 | |
18 | 18 | return; |
19 | 19 | } |
20 | 20 | |
21 | - if (is_array($countries[0])) { |
|
22 | - $countries = $countries[0]; |
|
21 | + if (is_array($countries[ 0 ])) { |
|
22 | + $countries = $countries[ 0 ]; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | foreach ($countries as $country) { |
26 | - $this->countries[] = $country; |
|
26 | + $this->countries[ ] = $country; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | private function isIbanValid(string $iban): bool |
37 | 37 | { |
38 | - if (! $this->checkIbanFormat($iban)) { |
|
38 | + if ( ! $this->checkIbanFormat($iban)) { |
|
39 | 39 | return false; |
40 | 40 | } |
41 | 41 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | private function isCountryValid(string $country, string $ibanCountryCode): bool |
136 | 136 | { |
137 | 137 | return ! empty($country) |
138 | - && isset($this->ibanLengthByCountry[$country]) |
|
138 | + && isset($this->ibanLengthByCountry[ $country ]) |
|
139 | 139 | && $ibanCountryCode === $country; |
140 | 140 | } |
141 | 141 | |
@@ -148,6 +148,6 @@ discard block |
||
148 | 148 | */ |
149 | 149 | private function isIbanLengthValid(string $iban, string $ibanCountryCode): bool |
150 | 150 | { |
151 | - return strlen($iban) === $this->ibanLengthByCountry[$ibanCountryCode]; |
|
151 | + return strlen($iban) === $this->ibanLengthByCountry[ $ibanCountryCode ]; |
|
152 | 152 | } |
153 | 153 | } |