1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Mixed contains everything (#5763)

This commit is contained in:
orklah 2021-05-15 02:23:54 +02:00 committed by GitHub
parent 4fb2b65164
commit 55079e92fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -266,6 +266,10 @@ class UnionTypeComparator
?Type\Union $input_type,
Type\Union $container_type
): bool {
if ($container_type->isMixed()) {
return true;
}
if (!$input_type) {
return false;
}

View File

@ -937,6 +937,22 @@ class MethodSignatureTest extends TestCase
use MyTrait;
}'
],
'MixedParamInImplementation' => [
'<?php
interface I
{
/**
* @param mixed $a
*/
public function a($a): void;
}
final class B implements I
{
public function a(mixed $a): void {}
}'
],
];
}