Skip to content

Commit 5835d0d

Browse files
iamfarhadgithub-actions[bot]
authored andcommitted
PHP Linting (Pint)
1 parent 389a9b8 commit 5835d0d

27 files changed

+65
-45
lines changed

src/Rules/Address.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value)) {
1616
$fail(__('validationRules::messages.address', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

src/Rules/Base64.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value)) {
1616
$fail(__('validationRules::messages.base64', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

src/Rules/CardNumber.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value) && ! is_numeric($value)) {
1616
$fail(__('validationRules::messages.cardNumber', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

2021
$value = (string) $value;
2122

2223
if (! preg_match('#^\d{16}$#', $value)) {
2324
$fail(__('validationRules::messages.cardNumber', ['attribute' => $attribute]));
25+
2426
return;
2527
}
2628

2729
$sum = 0;
28-
for ($position = 1; $position <= 16; ++$position) {
30+
for ($position = 1; $position <= 16; $position++) {
2931
$temp = (int) $value[$position - 1];
3032
$temp = $position % 2 === 0 ? $temp : $temp * 2;
3133
$temp = $temp > 9 ? $temp - 9 : $temp;

src/Rules/IsNotPersian.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value)) {
1616
$fail(__('validationRules::messages.isNotPersian', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

src/Rules/Mobile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value) && ! is_numeric($value)) {
1616
$fail(__('validationRules::messages.mobile', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

src/Rules/NationalCode.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,32 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value) && ! is_numeric($value)) {
1616
$fail(__('validationRules::messages.nationalCode', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

2021
$value = (string) $value;
2122

2223
if (! preg_match('#^\d{8,10}$#', $value)) {
2324
$fail(__('validationRules::messages.nationalCode', ['attribute' => $attribute]));
25+
2426
return;
2527
}
2628

2729
if (preg_match('#^[0]{10}|[1]{10}|[2]{10}|[3]{10}|[4]{10}|[5]{10}|[6]{10}|[7]{10}|[8]{10}|[9]{10}$#', $value)) {
2830
$fail(__('validationRules::messages.nationalCode', ['attribute' => $attribute]));
31+
2932
return;
3033
}
3134

3235
$sub = 0;
3336
if (strlen($value) == 8) {
34-
$value = '00' . $value;
37+
$value = '00'.$value;
3538
} elseif (strlen($value) == 9) {
36-
$value = '0' . $value;
39+
$value = '0'.$value;
3740
}
3841

39-
for ($i = 0; $i <= 8; ++$i) {
42+
for ($i = 0; $i <= 8; $i++) {
4043
$sub += $value[$i] * (10 - $i);
4144
}
4245

src/Rules/PersianAlpha.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value)) {
1616
$fail(__('validationRules::messages.persianAlpha', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

src/Rules/PersianNumber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value) && ! is_numeric($value)) {
1616
$fail(__('validationRules::messages.persianNumber', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

src/Rules/Phone.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value) && ! is_numeric($value)) {
1616
$fail(__('validationRules::messages.phone', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

src/Rules/PhoneArea.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1414
{
1515
if (! is_string($value) && ! is_numeric($value)) {
1616
$fail(__('validationRules::messages.phoneArea', ['attribute' => $attribute]));
17+
1718
return;
1819
}
1920

0 commit comments

Comments
 (0)