Skip to content

Commit

Permalink
fix @psalm-scope-this not working with FQCN with leading backslash
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Dec 30, 2022
1 parent 6353143 commit fcf4284
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Psalm/Internal/Analyzer/StatementsAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
use function get_class;
use function in_array;
use function is_string;
use function ltrim;
use function preg_split;
use function reset;
use function round;
Expand Down Expand Up @@ -793,6 +794,7 @@ private function parseStatementDocblock(

if (isset($comments->tags['psalm-scope-this'])) {
$trimmed = trim(reset($comments->tags['psalm-scope-this']));
$trimmed = ltrim($trimmed, '\\');

if (!$codebase->classExists($trimmed)) {
IssueBuffer::maybeAdd(
Expand Down

0 comments on commit fcf4284

Please sign in to comment.