Skip to content

Commit

Permalink
v6 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Jan 26, 2025
1 parent 0d33f63 commit 9fb900d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions src/Hooks/TestCaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ public static function afterClassLikeVisit(AfterClassLikeVisitEvent $event)

/**
* {@inheritDoc}
*
* @psalm-suppress DeprecatedClass TList will be removed soon
*/
public static function afterStatementAnalysis(AfterClassLikeAnalysisEvent $event)
{
Expand Down Expand Up @@ -389,7 +387,7 @@ static function (
}
};

/** @var Type\Atomic\TArray|Type\Atomic\TKeyedArray|Type\Atomic\TList $dataset_type */
/** @var Type\Atomic\TArray|Type\Atomic\TKeyedArray $dataset_type */
$dataset_type = self::getAtomics($provider_return_type->type_params[1])['array'];

if ($dataset_type instanceof Type\Atomic\TArray) {
Expand All @@ -401,14 +399,6 @@ static function (
}
$checkParam($potential_argument_type, $param->type, $param->is_optional, $param_offset);
}
} elseif ($dataset_type instanceof Type\Atomic\TList) {
$potential_argument_type = $dataset_type->type_param;
foreach ($method_storage->params as $param_offset => $param) {
if (!$param->type) {
continue;
}
$checkParam($potential_argument_type, $param->type, $param->is_optional, $param_offset);
}
} else { // TKeyedArray
// iterate over all params checking if corresponding value type is acceptable
// let's hope properties are sorted in array order
Expand Down Expand Up @@ -492,9 +482,6 @@ private static function unionizeIterables(Codebase $codebase, Type\Union $iterab
$value_types[] = $type->getGenericValueType();
} elseif ($type instanceof Type\Atomic\TNamedObject || $type instanceof Type\Atomic\TIterable) {
[$key_types[], $value_types[]] = $codebase->getKeyValueParamsForTraversableObject($type);
} elseif ($type instanceof Type\Atomic\TList) {
$key_types[] = Type::getInt();
$value_types[] = $type->type_param;
} else {
throw new RuntimeException('unexpected type');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/Assert75.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Assert (PHPUnit 7.5+)
Given I have the following config
"""
<?xml version="1.0"?>
<psalm>
<psalm findUnusedCode="false">
<projectFiles><directory name="." /></projectFiles>
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
Expand Down

0 comments on commit 9fb900d

Please sign in to comment.