Skip to content

Commit 5df2e4a

Browse files
authored
Merge branch '2.1.x' into generics-on-phpstan-types
2 parents 928ab12 + 9c915ec commit 5df2e4a

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

phpstan-baseline.neon

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ parameters:
17101710
-
17111711
rawMessage: 'Doing instanceof PHPStan\Type\Constant\ConstantStringType is error-prone and deprecated. Use Type::getConstantStrings() instead.'
17121712
identifier: phpstanApi.instanceofType
1713-
count: 3
1713+
count: 2
17141714
path: src/Type/TypeCombinator.php
17151715

17161716
-
@@ -1743,18 +1743,6 @@ parameters:
17431743
count: 2
17441744
path: src/Type/TypeCombinator.php
17451745

1746-
-
1747-
rawMessage: Instanceof between PHPStan\Type\Constant\ConstantIntegerType and PHPStan\Type\Constant\ConstantIntegerType will always evaluate to true.
1748-
identifier: instanceof.alwaysTrue
1749-
count: 1
1750-
path: src/Type/TypeCombinator.php
1751-
1752-
-
1753-
rawMessage: Result of || is always true.
1754-
identifier: booleanOr.alwaysTrue
1755-
count: 1
1756-
path: src/Type/TypeCombinator.php
1757-
17581746
-
17591747
rawMessage: Doing instanceof PHPStan\Type\IntersectionType is error-prone and deprecated.
17601748
identifier: phpstanApi.instanceofType

src/Type/TypeCombinator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,10 +793,7 @@ private static function processArrayAccessoryTypes(array $arrayTypes): array
793793
continue;
794794
}
795795
if ($innerType instanceof HasOffsetType) {
796-
$offset = $innerType->getOffsetType();
797-
if ($offset instanceof ConstantStringType || $offset instanceof ConstantIntegerType) {
798-
$innerType = new HasOffsetValueType($offset, $arrayType->getIterableValueType());
799-
}
796+
$innerType = new HasOffsetValueType($innerType->getOffsetType(), $arrayType->getIterableValueType());
800797
}
801798
if ($innerType instanceof HasOffsetValueType) {
802799
$accessoryTypes[sprintf('hasOffsetValue(%s)', $innerType->getOffsetType()->describe(VerbosityLevel::cache()))][$i] = $innerType;

0 commit comments

Comments
 (0)