Skip to content

Commit 4957fa0

Browse files
minor symfony#28458 [OptionsResolver] remove dead code and useless else (ronfroy)
This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes symfony#28458). Discussion ---------- [OptionsResolver] remove dead code and useless else | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT <!-- remove dead method and useless else --> Commits ------- 0c1484b [OptionsResolver] remove dead code and useless else
2 parents 5d75f14 + 0c1484b commit 4957fa0

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/Symfony/Component/OptionsResolver/OptionsResolver.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,9 @@ public function offsetGet($option)
770770

771771
// Don't include closures in the exception message
772772
continue;
773-
} elseif ($value === $allowedValue) {
773+
}
774+
775+
if ($value === $allowedValue) {
774776
$success = true;
775777
break;
776778
}
@@ -1060,20 +1062,4 @@ private static function isValueValidType($type, $value)
10601062
{
10611063
return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
10621064
}
1063-
1064-
/**
1065-
* @return array
1066-
*/
1067-
private function getInvalidValues(array $arrayValues, $type)
1068-
{
1069-
$invalidValues = array();
1070-
1071-
foreach ($arrayValues as $key => $value) {
1072-
if (!self::isValueValidType($type, $value)) {
1073-
$invalidValues[$key] = $value;
1074-
}
1075-
}
1076-
1077-
return $invalidValues;
1078-
}
10791065
}

0 commit comments

Comments
 (0)