1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Move exception classes

This commit is contained in:
Brown 2019-06-05 11:33:04 -04:00
parent 6f0a6201de
commit ddd287fb3d
2 changed files with 22 additions and 0 deletions

View File

@ -170,6 +170,16 @@ class TryAnalyzer
$statements_analyzer->getAliases()
);
if ($codebase->alter_code && $fq_catch_class) {
$codebase->classlikes->handleClassLikeReferenceInMigration(
$codebase,
$statements_analyzer,
$catch_type,
$fq_catch_class,
$context->calling_method_id
);
}
if ($original_context->check_classes) {
if (ClassLikeAnalyzer::checkFullyQualifiedClassLikeName(
$statements_analyzer,

View File

@ -280,6 +280,12 @@ class ClassMoveTest extends \Psalm\Tests\TestCase
$b->bar();
}
try {
// something
} catch (InvalidArgumentException $e) {
}
echo \A::class;
ArrayObject::foo();
@ -306,6 +312,12 @@ class ClassMoveTest extends \Psalm\Tests\TestCase
$b->bar();
}
try {
// something
} catch (\InvalidArgumentException $e) {
}
echo self::class;
\ArrayObject::foo();