Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 6, 2024
1 parent 3990758 commit 4dad6d1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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));

Check failure on line 849 in src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, lowest)

Cannot access property $value on PhpParser\Node\ArrayItem|null.

Check failure on line 849 in src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, lowest)

Cannot access property $value on PhpParser\Node\ArrayItem|null.

Check failure on line 849 in src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, lowest)

Cannot access property $value on PhpParser\Node\ArrayItem|null.

Check failure on line 849 in src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, lowest)

Cannot access property $value on PhpParser\Node\ArrayItem|null.

Check failure on line 849 in src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, lowest)

Cannot access property $value on PhpParser\Node\ArrayItem|null.

Check failure on line 849 in src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, lowest)

Cannot access property $value on PhpParser\Node\ArrayItem|null.
if ($resolved === null) {
continue;
Expand Down

0 comments on commit 4dad6d1

Please sign in to comment.