Skip to content

Commit be66990

Browse files
committed
Upgrade coding standard
1 parent ae7c379 commit be66990

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"require-dev": {
4242
"ext-xdebug": "*",
43-
"aplus/coding-standard": "^2.0",
43+
"aplus/coding-standard": "^2.8",
4444
"ergebnis/composer-normalize": "^2.25",
4545
"jetbrains/phpstorm-attributes": "^1.0",
4646
"phpmd/phpmd": "^2.13",

src/FilesValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected static function getOrganizedFiles() : array
3838
*
3939
* @return array<string,mixed>|null
4040
*/
41-
protected static function getFile(string $field) : array | null
41+
protected static function getFile(string $field) : ?array
4242
{
4343
$files = static::getOrganizedFiles();
4444
return ArraySimple::value($field, $files);

src/Validation.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Validation
5252
/**
5353
* The current Validators.
5454
*
55-
* @var array<int,string|Validator> Values are the Validators FQCN or
55+
* @var array<int,Validator|string> Values are the Validators FQCN or
5656
* instances
5757
*/
5858
protected array $validators = [];
@@ -67,10 +67,10 @@ class Validation
6767
/**
6868
* Validation constructor.
6969
*
70-
* @param array<int,string|Validator>|null $validators
70+
* @param array<int,Validator|string>|null $validators
7171
* @param Language|null $language
7272
*/
73-
public function __construct(array $validators = null, Language $language = null)
73+
public function __construct(?array $validators = null, ?Language $language = null)
7474
{
7575
$defaultValidators = [
7676
Validator::class,
@@ -84,7 +84,7 @@ public function __construct(array $validators = null, Language $language = null)
8484
}
8585
}
8686

87-
public function setLanguage(Language $language = null) : static
87+
public function setLanguage(?Language $language = null) : static
8888
{
8989
if ($language === null) {
9090
$language = new Language();
@@ -103,7 +103,7 @@ public function getLanguage() : Language
103103
}
104104

105105
/**
106-
* @return array<int,string|Validator>
106+
* @return array<int,Validator|string>
107107
*/
108108
public function getValidators() : array
109109
{
@@ -676,7 +676,7 @@ public function setDebugCollector(ValidationCollector $debugCollector) : static
676676
return $this;
677677
}
678678

679-
public function getDebugCollector() : ValidationCollector | null
679+
public function getDebugCollector() : ?ValidationCollector
680680
{
681681
return $this->debugCollector ?? null;
682682
}

tests/Debug/ValidationCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static function bar(
101101
string $field,
102102
array $data,
103103
string $str = 'foo',
104-
string $null = null
104+
?string $null = null
105105
) : bool {
106106
return false;
107107
}

0 commit comments

Comments
 (0)