With the method below phpstan since lately reports the false-positive "Call to static method PHPUnit\Framework\Assert::assertCount() with int<0, max> and array will always evaluate to true."
/**
* @param array<int|string> $expectedKeys
* @param array<mixed> $actual
*/
public static function assertArrayHasSameKeys(array $expectedKeys, array $actual): void {
\PHPUnit\Framework\Assert::assertCount(count($expectedKeys), $actual);
// ...
}
Used versions:
phpstan/phpstan 2.2.14
phpstan/phpstan-phpunit 2.0.18
With the method below phpstan since lately reports the false-positive "Call to static method PHPUnit\Framework\Assert::assertCount() with int<0, max> and array will always evaluate to true."
Used versions:
phpstan/phpstan 2.2.14
phpstan/phpstan-phpunit 2.0.18