From be669900bd186dd281f83bb9abf949d6ec56cb7f Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Sat, 24 Aug 2024 16:07:37 -0300 Subject: [PATCH] Upgrade coding standard --- composer.json | 2 +- src/FilesValidator.php | 2 +- src/Validation.php | 12 ++++++------ tests/Debug/ValidationCollectorTest.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 7431d7c..7ea16ad 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ }, "require-dev": { "ext-xdebug": "*", - "aplus/coding-standard": "^2.0", + "aplus/coding-standard": "^2.8", "ergebnis/composer-normalize": "^2.25", "jetbrains/phpstorm-attributes": "^1.0", "phpmd/phpmd": "^2.13", diff --git a/src/FilesValidator.php b/src/FilesValidator.php index f97d02b..dffcc1e 100644 --- a/src/FilesValidator.php +++ b/src/FilesValidator.php @@ -38,7 +38,7 @@ protected static function getOrganizedFiles() : array * * @return array|null */ - protected static function getFile(string $field) : array | null + protected static function getFile(string $field) : ?array { $files = static::getOrganizedFiles(); return ArraySimple::value($field, $files); diff --git a/src/Validation.php b/src/Validation.php index 6411863..31e2afc 100644 --- a/src/Validation.php +++ b/src/Validation.php @@ -52,7 +52,7 @@ class Validation /** * The current Validators. * - * @var array Values are the Validators FQCN or + * @var array Values are the Validators FQCN or * instances */ protected array $validators = []; @@ -67,10 +67,10 @@ class Validation /** * Validation constructor. * - * @param array|null $validators + * @param array|null $validators * @param Language|null $language */ - public function __construct(array $validators = null, Language $language = null) + public function __construct(?array $validators = null, ?Language $language = null) { $defaultValidators = [ Validator::class, @@ -84,7 +84,7 @@ public function __construct(array $validators = null, Language $language = null) } } - public function setLanguage(Language $language = null) : static + public function setLanguage(?Language $language = null) : static { if ($language === null) { $language = new Language(); @@ -103,7 +103,7 @@ public function getLanguage() : Language } /** - * @return array + * @return array */ public function getValidators() : array { @@ -676,7 +676,7 @@ public function setDebugCollector(ValidationCollector $debugCollector) : static return $this; } - public function getDebugCollector() : ValidationCollector | null + public function getDebugCollector() : ?ValidationCollector { return $this->debugCollector ?? null; } diff --git a/tests/Debug/ValidationCollectorTest.php b/tests/Debug/ValidationCollectorTest.php index c3b3b99..2234f71 100644 --- a/tests/Debug/ValidationCollectorTest.php +++ b/tests/Debug/ValidationCollectorTest.php @@ -101,7 +101,7 @@ public static function bar( string $field, array $data, string $str = 'foo', - string $null = null + ?string $null = null ) : bool { return false; }