mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Prevent Throwable being intersected with itself
This commit is contained in:
parent
fea1310d67
commit
556d5625b5
@ -297,6 +297,7 @@ class TryAnalyzer
|
|||||||
$catch_class_type = new TNamedObject($fq_catch_class);
|
$catch_class_type = new TNamedObject($fq_catch_class);
|
||||||
|
|
||||||
if (version_compare(PHP_VERSION, '7.0.0dev', '>=')
|
if (version_compare(PHP_VERSION, '7.0.0dev', '>=')
|
||||||
|
&& strtolower($fq_catch_class) !== 'throwable'
|
||||||
&& $codebase->interfaceExists($fq_catch_class)
|
&& $codebase->interfaceExists($fq_catch_class)
|
||||||
&& !$codebase->interfaceExtends($fq_catch_class, 'Throwable')
|
&& !$codebase->interfaceExtends($fq_catch_class, 'Throwable')
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user