Skip to content

Commit 8fcfb1d

Browse files
Merge branch '4.4' into 5.1
* 4.4: Changed private static array-properties to const
2 parents 2080ca3 + 4df3400 commit 8fcfb1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

OptionsResolver.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class OptionsResolver implements Options
110110

111111
private $parentsOptions = [];
112112

113-
private static $typeAliases = [
113+
private const TYPE_ALIASES = [
114114
'boolean' => 'bool',
115115
'integer' => 'int',
116116
'double' => 'float',
@@ -996,7 +996,7 @@ public function offsetGet($option, bool $triggerDeprecation = true)
996996
$invalidTypes = [];
997997

998998
foreach ($this->allowedTypes[$option] as $type) {
999-
$type = self::$typeAliases[$type] ?? $type;
999+
$type = self::TYPE_ALIASES[$type] ?? $type;
10001000

10011001
if ($valid = $this->verifyTypes($type, $value, $invalidTypes)) {
10021002
break;
@@ -1008,7 +1008,7 @@ public function offsetGet($option, bool $triggerDeprecation = true)
10081008
$fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]);
10091009
$fmtProvidedTypes = implode('|', array_keys($invalidTypes));
10101010
$allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) {
1011-
return '[]' === substr(self::$typeAliases[$item] ?? $item, -2);
1011+
return '[]' === substr(self::TYPE_ALIASES[$item] ?? $item, -2);
10121012
})) > 0;
10131013

10141014
if (\is_array($value) && $allowedContainsArrayType) {

0 commit comments

Comments
 (0)