Skip to content

Commit db1f330

Browse files
fix qa
1 parent 311197a commit db1f330

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

src/Validation/BuildValidationRule.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
use Shergela\Validations\Enums\ValidationRegexEnum as RegexRule;
99
use Shergela\Validations\Enums\ValidationRuleEnum as Rule;
1010
use Shergela\Validations\Enums\ValidationStringEnum as StringRule;
11-
use Shergela\Validations\Rules\LowercaseFirstLetter;
12-
use Shergela\Validations\Rules\SeparateIntegersByComma;
13-
use Shergela\Validations\Rules\SeparateStringsByComma;
14-
use Shergela\Validations\Rules\SeparateStringsByUnderscore;
15-
use Shergela\Validations\Rules\TimezoneValidation;
16-
use Shergela\Validations\Rules\TimezoneRegionValidation;
17-
use Shergela\Validations\Rules\UppercaseFirstLetter;
11+
use Shergela\Validations\Rules\LowercaseFirstLetter as LowerFL;
12+
use Shergela\Validations\Rules\SeparateIntegersByComma as IntegerByComma;
13+
use Shergela\Validations\Rules\SeparateStringsByComma as StringByComma;
14+
use Shergela\Validations\Rules\SeparateStringsByUnderscore as StringByUnderscore;
15+
use Shergela\Validations\Rules\TimezoneRegionValidation as TimezoneRegion;
16+
use Shergela\Validations\Rules\TimezoneValidation as Timezone;
17+
use Shergela\Validations\Rules\UppercaseFirstLetter as UpperFL;
1818

1919
class BuildValidationRule
2020
{
@@ -312,7 +312,7 @@ class BuildValidationRule
312312
protected static ?string $notIn = null;
313313

314314
/**
315-
* @return array<UppercaseFirstLetter|SeparateIntegersByComma|SeparateStringsByComma|SeparateStringsByUnderscore|string>
315+
* @return array<int,LowerFL|IntegerByComma|StringByComma|StringByUnderscore|TimezoneRegion|Timezone|UpperFL|string>
316316
*/
317317
protected function buildValidationRules(): array
318318
{
@@ -374,8 +374,8 @@ protected function buildValidationRules(): array
374374
...($this->endsWith !== null ? [$this->endsWith] : []),
375375
...($this->doesntStartWith !== null ? [$this->doesntStartWith] : []),
376376
...($this->doesntEndWith !== null ? [$this->doesntEndWith] : []),
377-
...($this->uppercaseFirstLetter === true ? [new UppercaseFirstLetter()] : []),
378-
...($this->lowercaseFirstLetter === true ? [new LowercaseFirstLetter()] : []),
377+
...($this->uppercaseFirstLetter === true ? [new UpperFL()] : []),
378+
...($this->lowercaseFirstLetter === true ? [new LowerFL()] : []),
379379

380380
/**
381381
* --------------------------------------------------------------------------------
@@ -387,12 +387,12 @@ protected function buildValidationRules(): array
387387
...($this->dateBefore !== null ? [DateRule::DATE_BEFORE . $this->dateBefore] : []),
388388
...($this->dateFormat !== null ? [DateRule::DATE_FORMAT . $this->dateFormat] : []),
389389
...($this->timezone !== null ? [DateRule::TIMEZONE_ALL] : []),
390-
...($this->timezones !== null ? [new TimezoneValidation(timezones: $this->timezones)] : []),
390+
...($this->timezones !== null ? [new Timezone(timezones: $this->timezones)] : []),
391391

392392
...(
393393
!empty($this->timezoneIdentifierCities)
394394
? [
395-
new TimezoneRegionValidation(
395+
new TimezoneRegion(
396396
cities: $this->timezoneIdentifierCities,
397397
timezoneGroupNumber: $this->dateTimezoneGroupNumber,
398398
timezoneGroup: $this->dateTimezoneGroupName
@@ -416,9 +416,9 @@ protected function buildValidationRules(): array
416416
* Regex validations
417417
*/
418418
...($this->regexPattern !== null ? [RegexRule::RULE . $this->regexPattern] : []),
419-
...($this->separateIntegersByComma === true ? [new SeparateIntegersByComma()] : []),
420-
...($this->separateStringsByComma === true ? [new SeparateStringsByComma()] : []),
421-
...($this->separateStringsByUnderscore === true ? [new SeparateStringsByUnderscore()] : []),
419+
...($this->separateIntegersByComma === true ? [new IntegerByComma()] : []),
420+
...($this->separateStringsByComma === true ? [new StringByComma()] : []),
421+
...($this->separateStringsByUnderscore === true ? [new StringByUnderscore()] : []),
422422
];
423423
}
424424
}

src/Validation/Rule.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
use Shergela\Validations\Enums\ValidationIntegerEnum as IntegerRule;
1616
use Shergela\Validations\Enums\ValidationRuleEnum as RuleEnum;
1717
use Shergela\Validations\Enums\ValidationStringEnum as StringRule;
18-
use Shergela\Validations\Rules\SeparateIntegersByComma;
19-
use Shergela\Validations\Rules\SeparateStringsByComma;
20-
use Shergela\Validations\Rules\SeparateStringsByUnderscore;
21-
use Shergela\Validations\Rules\UppercaseFirstLetter;
18+
use Shergela\Validations\Rules\LowercaseFirstLetter as LowerFL;
19+
use Shergela\Validations\Rules\SeparateIntegersByComma as IntegerByComma;
20+
use Shergela\Validations\Rules\SeparateStringsByComma as StringByComma;
21+
use Shergela\Validations\Rules\SeparateStringsByUnderscore as StringByUnderscore;
22+
use Shergela\Validations\Rules\TimezoneRegionValidation as TimezoneRegion;
23+
use Shergela\Validations\Rules\TimezoneValidation as Timezone;
24+
use Shergela\Validations\Rules\UppercaseFirstLetter as UpperFL;
2225

2326
class Rule extends BuildValidationRule implements ValidationRule, ValidatorAwareRule, DataAwareRule
2427
{
@@ -932,7 +935,7 @@ public static function notIn(array $values): Rule
932935
}
933936

934937
/**
935-
* @return array<UppercaseFirstLetter|SeparateIntegersByComma|SeparateStringsByComma|SeparateStringsByUnderscore|string>
938+
* @return array<int,LowerFL|IntegerByComma|StringByComma|StringByUnderscore|TimezoneRegion|Timezone|UpperFL|string>
936939
*/
937940
private function getValidationRules(): array
938941
{

0 commit comments

Comments
 (0)