mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
parent
769ac5c052
commit
ef53ee3a3b
@ -211,6 +211,8 @@ class TryAnalyzer
|
||||
$statements_analyzer->getAliases()
|
||||
);
|
||||
|
||||
$fq_catch_class = $codebase->classlikes->getUnAliasedName($fq_catch_class);
|
||||
|
||||
if ($codebase->alter_code && $fq_catch_class) {
|
||||
$codebase->classlikes->handleClassLikeReferenceInMigration(
|
||||
$codebase,
|
||||
|
@ -301,6 +301,31 @@ class TryCatchTest extends TestCase
|
||||
} while (rand(0, 1));
|
||||
}'
|
||||
],
|
||||
'aliasException' => [
|
||||
'<?php
|
||||
namespace UserException;
|
||||
|
||||
class UserException extends \Exception {
|
||||
|
||||
}
|
||||
|
||||
namespace Alias\UserException;
|
||||
|
||||
use function class_alias;
|
||||
|
||||
class_alias(
|
||||
\UserException\UserException::class,
|
||||
\Alias\UserException\UserExceptionAlias::class
|
||||
);
|
||||
|
||||
namespace Client;
|
||||
|
||||
try {
|
||||
throw new \Alias\UserException\UserExceptionAlias();
|
||||
} catch (\Alias\UserException\UserExceptionAlias $e) {
|
||||
// do nothing
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user