Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused class/method misses const strings with leading backslash #3607

Closed
iluuu1994 opened this issue Jun 18, 2020 · 3 comments
Closed

Unused class/method misses const strings with leading backslash #3607

iluuu1994 opened this issue Jun 18, 2020 · 3 comments
Labels
bug easy problems Issues that can be fixed without background knowledge of Psalm

Comments

@iluuu1994
Copy link
Contributor

This one is fine:
https://psalm.dev/r/17dc5a2e45

Psalm misses this one:
https://psalm.dev/r/c5d8cd84d8

But adding a leading backslash is legal:
https://3v4l.org/R1B3f

Thanks!

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/17dc5a2e45
<?php

class Foo {
    public static function bar(): void {}
}

$callable = 'Foo::bar';
$callable();
Psalm output (using commit 21e5678):

No issues!
https://psalm.dev/r/c5d8cd84d8
<?php

class Foo {
    public static function bar(): void {}
}

$callable = '\Foo::bar';
$callable();
Psalm output (using commit 21e5678):

INFO: UnusedClass - 3:7 - Class Foo is never used

@muglug muglug added bug easy problems Issues that can be fixed without background knowledge of Psalm labels Jun 18, 2020
@muglug
Copy link
Collaborator

muglug commented Jun 18, 2020

Mind a PR? This shouldn't be too difficult

@iluuu1994
Copy link
Contributor Author

@muglug Sure 🙂 I'll do it when I'm off from work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug easy problems Issues that can be fixed without background knowledge of Psalm
Projects
None yet
Development

No branches or pull requests

2 participants