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

Importing global functions without backslash causes them to show as unused. #15

Closed
neufena opened this issue Jan 3, 2019 · 2 comments
Closed

Comments

@neufena
Copy link

neufena commented Jan 3, 2019

an example of this:

use function assert;

gets highlighted in red as unused but

use function \assert;

does not.

@marabesi
Copy link
Owner

marabesi commented Jan 4, 2019

Could you give an example with real code?

Something like the examples in the repo https://github.com/marabesi/php-import-checker/blob/master/test/examples/snippet9.php

@neufena
Copy link
Author

neufena commented Jan 10, 2019

Sorry for the delay. This code highlights line 11 red:

<?php

/**
 * Should not highlight used function
 */

namespace App;

use Example;

use function assert;

class Test
{
    public function foo() : Example
    {
        assert(true);
         // ...
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants