Skip to content

Commit 2d8a3c8

Browse files
Fix support for PHP8 union types
1 parent 837925c commit 2d8a3c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OptionsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function setDefault($option, $value)
201201
return $this;
202202
}
203203

204-
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()))) {
204+
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()))) {
205205
// Store closure for later evaluation
206206
$this->nested[$option][] = $value;
207207
$this->defaults[$option] = [];

0 commit comments

Comments
 (0)