Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Oct 26, 2024
1 parent 34fb83d commit c54b257
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,11 @@ parameters:
count: 2
path: src/Rules/RuleLevelHelper.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\ObjectType is error\\-prone and deprecated\\. Use Type\\:\\:isObject\\(\\) or Type\\:\\:getObjectClassNames\\(\\) instead\\.$#"
count: 2
path: src/Rules/RuleLevelHelper.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\ObjectWithoutClassType is error\\-prone and deprecated\\. Use Type\\:\\:isObject\\(\\) instead\\.$#"
count: 1
Expand Down
6 changes: 3 additions & 3 deletions src/Type/TypeCombinator.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ private static function optimizeConstantArrays(array $types): array

$innerValueType = $type->getValueTypes()[$i];
$generalizedValueType = TypeTraverser::map($innerValueType, static function (Type $type) use ($traverse): Type {
if ($type instanceof ArrayType || $type instanceof ConstantArrayType) {
if ($type instanceof ArrayType) {
return TypeCombinator::intersect($type, new OversizedArrayType());
}

Expand Down Expand Up @@ -853,8 +853,8 @@ private static function optimizeConstantArrays(array $types): array
$eachIsList = false;
}

$keyType = self::union(...array_values($keyTypes));
$valueType = self::union(...array_values($valueTypes));
$keyType = self::union(...$keyTypes);
$valueType = self::union(...$valueTypes);

$arrayType = new ArrayType($keyType, $valueType);
if ($eachIsList) {
Expand Down

0 comments on commit c54b257

Please sign in to comment.