mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
fix is_a when used with Stringable classes
This commit is contained in:
parent
526debbec4
commit
ce87fc4882
@ -1298,6 +1298,6 @@ function get_defined_constants(bool $categorize = false): array {}
|
||||
/**
|
||||
* @param mixed $object_or_class
|
||||
* @param class-string $class
|
||||
* @return ($allow_string is false ? ($object_or_class is string ? false : bool) : bool)
|
||||
* @return ($allow_string is false ? ($object_or_class is object ? bool : false) : bool)
|
||||
*/
|
||||
function is_a($object_or_class, string $class, $allow_string = false): bool{}
|
@ -1662,6 +1662,14 @@ class FunctionCallTest extends TestCase
|
||||
foo(...$arguments);
|
||||
',
|
||||
],
|
||||
'is_aWithStringableClass' => [
|
||||
'<?php
|
||||
/**
|
||||
* @psalm-var class-string<Throwable> $exceptionType
|
||||
*/
|
||||
if (\is_a(new Exception(), $exceptionType)) {}
|
||||
',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user