Skip to content

Commit 50ea209

Browse files
committed
Fix build
1 parent 71013bc commit 50ea209

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: "#^Strict comparison using \\=\\=\\= between PhpParser\\\\Node\\\\Expr\\\\ArrayItem and null will always evaluate to false\\.$#"
5-
count: 1
6-
path: src/Analyser/MutatingScope.php
7-
83
-
94
message: "#^Only numeric types are allowed in pre\\-increment, bool\\|float\\|int\\|string\\|null given\\.$#"
105
count: 1

src/Analyser/NodeScopeResolver.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,9 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
18201820
$itemNodes = [];
18211821
$hasYield = false;
18221822
foreach ($expr->items as $arrayItem) {
1823+
if ($arrayItem === null) {
1824+
throw new \PHPStan\ShouldNotHappenException();
1825+
}
18231826
$itemNodes[] = new LiteralArrayItem($scope, $arrayItem);
18241827
$result = $this->processExprNode($arrayItem, $scope, $nodeCallback, $context->enterDeep());
18251828
$hasYield = $hasYield || $result->hasYield();

src/Type/Php/IsCallableFunctionTypeSpecifyingExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public function specifyTypes(FunctionReflection $functionReflection, FuncCall $n
4949
&& $valueType instanceof ConstantArrayType
5050
&& !$valueType->isCallable()->no()
5151
) {
52+
if ($value->items[0] === null || $value->items[1] === null) {
53+
throw new \PHPStan\ShouldNotHappenException();
54+
}
55+
5256
$functionCall = new FuncCall(new Name('method_exists'), [
5357
new Arg($value->items[0]->value),
5458
new Arg($value->items[1]->value),

0 commit comments

Comments
 (0)