Skip to content

Commit 468f7f8

Browse files
committed
Fix build after merge
1 parent d7e46d2 commit 468f7f8

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

src/Analyser/MutatingScope.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4920,7 +4920,7 @@ public function processClosureScope(
49204920
$prevVariableType = $prevScope->getVariableType($variableName);
49214921
if (!$variableType->equals($prevVariableType)) {
49224922
$variableType = TypeCombinator::union($variableType, $prevVariableType);
4923-
$variableType = self::generalizeType($variableType, $prevVariableType, 0);
4923+
$variableType = $this->generalizeType($variableType, $prevVariableType, 0);
49244924
}
49254925
}
49264926

@@ -5045,15 +5045,15 @@ private function generalizeVariableTypeHolders(
50455045

50465046
$variableTypeHolders[$variableExprString] = new ExpressionTypeHolder(
50475047
$variableTypeHolder->getExpr(),
5048-
self::generalizeType($variableTypeHolder->getType(), $otherVariableTypeHolders[$variableExprString]->getType(), 0),
5048+
$this->generalizeType($variableTypeHolder->getType(), $otherVariableTypeHolders[$variableExprString]->getType(), 0),
50495049
$variableTypeHolder->getCertainty(),
50505050
);
50515051
}
50525052

50535053
return $variableTypeHolders;
50545054
}
50555055

5056-
private static function generalizeType(Type $a, Type $b, int $depth): Type
5056+
private function generalizeType(Type $a, Type $b, int $depth): Type
50575057
{
50585058
if ($a->equals($b)) {
50595059
return $a;
@@ -5146,7 +5146,7 @@ private static function generalizeType(Type $a, Type $b, int $depth): Type
51465146
foreach (TypeUtils::flattenTypes($constantArraysA->getIterableKeyType()) as $keyType) {
51475147
$resultArrayBuilder->setOffsetValueType(
51485148
$keyType,
5149-
self::generalizeType(
5149+
$this->generalizeType(
51505150
$constantArraysA->getOffsetValueType($keyType),
51515151
$constantArraysB->getOffsetValueType($keyType),
51525152
$depth + 1,
@@ -5158,13 +5158,13 @@ private static function generalizeType(Type $a, Type $b, int $depth): Type
51585158
$resultTypes[] = $resultArrayBuilder->getArray();
51595159
} else {
51605160
$resultType = new ArrayType(
5161-
TypeCombinator::union(self::generalizeType($constantArraysA->getIterableKeyType(), $constantArraysB->getIterableKeyType(), $depth + 1)),
5162-
TypeCombinator::union(self::generalizeType($constantArraysA->getIterableValueType(), $constantArraysB->getIterableValueType(), $depth + 1)),
5161+
TypeCombinator::union($this->generalizeType($constantArraysA->getIterableKeyType(), $constantArraysB->getIterableKeyType(), $depth + 1)),
5162+
TypeCombinator::union($this->generalizeType($constantArraysA->getIterableValueType(), $constantArraysB->getIterableValueType(), $depth + 1)),
51635163
);
51645164
if (
51655165
$constantArraysA->isIterableAtLeastOnce()->yes()
51665166
&& $constantArraysB->isIterableAtLeastOnce()->yes()
5167-
&& $constantArraysA->getArraySize()->getGreaterOrEqualType()->isSuperTypeOf($constantArraysB->getArraySize())->yes()
5167+
&& $constantArraysA->getArraySize()->getGreaterOrEqualType($this->phpVersion)->isSuperTypeOf($constantArraysB->getArraySize())->yes()
51685168
) {
51695169
$resultType = TypeCombinator::intersect($resultType, new NonEmptyArrayType());
51705170
}
@@ -5205,8 +5205,8 @@ private static function generalizeType(Type $a, Type $b, int $depth): Type
52055205
}
52065206

52075207
$resultType = new ArrayType(
5208-
TypeCombinator::union(self::generalizeType($generalArraysA->getIterableKeyType(), $generalArraysB->getIterableKeyType(), $depth + 1)),
5209-
TypeCombinator::union(self::generalizeType($aValueType, $bValueType, $depth + 1)),
5208+
TypeCombinator::union($this->generalizeType($generalArraysA->getIterableKeyType(), $generalArraysB->getIterableKeyType(), $depth + 1)),
5209+
TypeCombinator::union($this->generalizeType($aValueType, $bValueType, $depth + 1)),
52105210
);
52115211
if ($generalArraysA->isIterableAtLeastOnce()->yes() && $generalArraysB->isIterableAtLeastOnce()->yes()) {
52125212
$resultType = TypeCombinator::intersect($resultType, new NonEmptyArrayType());

tests/PHPStan/Analyser/nsrt/bug-1021.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function foobar() {
1313
}
1414
}
1515

16-
assertType('array<1|2|3>&list', $x);
16+
assertType('list<1|2|3>', $x);
1717

1818
if ($x) {
1919
}

tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ public function testLastMatchArm(bool $reportAlwaysTrueInLastCondition, array $e
738738

739739
public function testBug8030(): void
740740
{
741-
$this->checkAlwaysTrueStrictComparison = true;
742741
$this->analyse([__DIR__ . '/data/bug-8030.php'], []);
743742
}
744743

tests/PHPStan/Rules/Variables/EmptyRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ public function testBug9403(bool $treatPhpDocTypesAsCertain): void
202202
public function testBug12658(): void
203203
{
204204
$this->treatPhpDocTypesAsCertain = true;
205-
$this->strictUnnecessaryNullsafePropertyFetch = false;
206205

207206
$this->analyse([__DIR__ . '/data/bug-12658.php'], []);
208207
}

0 commit comments

Comments
 (0)