Skip to content

Commit 4df3400

Browse files
committed
Changed private static array-properties to const
1 parent 89204fc commit 4df3400

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
@@ -105,7 +105,7 @@ class OptionsResolver implements Options
105105

106106
private $parentsOptions = [];
107107

108-
private static $typeAliases = [
108+
private const TYPE_ALIASES = [
109109
'boolean' => 'bool',
110110
'integer' => 'int',
111111
'double' => 'float',
@@ -926,7 +926,7 @@ public function offsetGet($option/*, bool $triggerDeprecation = true*/)
926926
$invalidTypes = [];
927927

928928
foreach ($this->allowedTypes[$option] as $type) {
929-
$type = self::$typeAliases[$type] ?? $type;
929+
$type = self::TYPE_ALIASES[$type] ?? $type;
930930

931931
if ($valid = $this->verifyTypes($type, $value, $invalidTypes)) {
932932
break;
@@ -938,7 +938,7 @@ public function offsetGet($option/*, bool $triggerDeprecation = true*/)
938938
$fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]);
939939
$fmtProvidedTypes = implode('|', array_keys($invalidTypes));
940940
$allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) {
941-
return '[]' === substr(self::$typeAliases[$item] ?? $item, -2);
941+
return '[]' === substr(self::TYPE_ALIASES[$item] ?? $item, -2);
942942
})) > 0;
943943

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

0 commit comments

Comments
 (0)