diff --git a/src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php b/src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php index 8d82409..817dfa1 100644 --- a/src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php +++ b/src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php @@ -215,7 +215,7 @@ private function createExpression( */ private function getExpressionResolvers(): array { - if ($this->resolvers === null) { + if (!isset($this->resolvers)) { $this->resolvers = [ 'integer' => static fn (Scope $scope, Arg $value): Expr => new FuncCall( new Name('is_int'), @@ -840,16 +840,12 @@ private static function implodeExpr(array $expressions, string $binaryOp): ?Expr private static function buildAnyOfExpr(Scope $scope, Arg $value, Arg $items, callable $resolver): ?Expr { - if (!$items->value instanceof Array_ || $items->value->items === null) { + if (!$items->value instanceof Array_) { return null; } $resolvers = []; foreach ($items->value->items as $key => $item) { - if ($item === null) { - continue; - } - $resolved = $resolver($scope, $value, new Arg($item->value)); if ($resolved === null) { continue;