Skip to content

Commit 9ae2b94

Browse files
Merge branch '5.1'
* 5.1: (28 commits) [DI] fix Use "composer/package-versions-deprecated" when possible Fix Small update in our internal terminology Fix support for PHP8 union types [VarDumper] fix typo [Lock][Messenger] Fix precedence of DSN options for 5.1 Fix support for PHP8 union types [FrameworkBundle] preserve dots in query-string when redirecting [3.4] Fix support for PHP8 union types [PhpUnitBridge] Streamline ansi/no-ansi of composer according to phpunit --colors option [3.4] Small update in our internal terminology [Cache] fix compat with DBAL v3 Remove unnecessary null check [HttpFoundation] Allow `null` in InputBag@set [HttpClient] Convert CurlHttpClient::handlePush() to instance method Fix package rename when releasing bumped Symfony version to 5.1.3 updated VERSION for 5.1.2 updated CHANGELOG for 5.1.2 ...
2 parents f3f9b9c + 8620e1c commit 9ae2b94

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

OptionsResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function setDefault(string $option, $value)
206206
return $this;
207207
}
208208

209-
if (isset($params[0]) && null !== ($type = $params[0]->getType()) && self::class === $type->getName() && (!isset($params[1]) || (null !== ($type = $params[1]->getType()) && Options::class === $type->getName()))) {
209+
if (isset($params[0]) && null !== ($type = $params[0]->getType()) && self::class === $type->getName() && (!isset($params[1]) || (($type = $params[1]->getType()) instanceof \ReflectionNamedType && Options::class === $type->getName()))) {
210210
// Store closure for later evaluation
211211
$this->nested[$option][] = $value;
212212
$this->defaults[$option] = [];
@@ -1283,7 +1283,7 @@ private function formatOptions(array $options): string
12831283

12841284
private function getParameterClassName(\ReflectionParameter $parameter): ?string
12851285
{
1286-
if (!($type = $parameter->getType()) || $type->isBuiltin()) {
1286+
if (!($type = $parameter->getType()) instanceof \ReflectionNamedType || $type->isBuiltin()) {
12871287
return null;
12881288
}
12891289

0 commit comments

Comments
 (0)