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

Variable $dbi in PHPDoc tag @var does not exist. #4500

Closed
williamdes opened this issue Feb 6, 2021 · 7 comments
Closed

Variable $dbi in PHPDoc tag @var does not exist. #4500

williamdes opened this issue Feb 6, 2021 · 7 comments

Comments

@williamdes
Copy link

Bug report

image

https://phpstan.org/r/92033ccc-e1e5-4be4-bb5b-6059527a9f27

Code snippet that reproduces the problem

    /**
     * Test for isMerge -- when ENGINE info is MERGE
     */
    public function testIsMergeCase2(): void
    {
        /** @var DatabaseInterface $dbi */
        global $dbi;

Expected output

As before, let me document globals, they are valid for some IDEs

PS: could you fix phpstan.dev website ?

@MartinMystikJonas
Copy link
Contributor

MartinMystikJonas commented Feb 6, 2021

You trying to define global variable but in local scope. I think you should define global variable in global scope. Just moving your var tag outside class should solve this.

@ondrejmirtes
Copy link
Member

Actual problem reproduction: https://phpstan.org/r/4f95e99a-0ca6-4e75-babd-d298edb01362

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@fa5f8ec

@williamdes
Copy link
Author

Fixed: phpstan/phpstan-src@fa5f8ec

Awesome 🥇 !
Impatient to test the next release and its positive side effects

@ondrejmirtes
Copy link
Member

@williamdes PHPStan 0.12.73 is out :) The inline @var support is quite reworked there, so please test it and let me know if you find any problems.

williamdes referenced this issue in phpmyadmin/phpmyadmin Feb 7, 2021
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
williamdes added a commit to phpmyadmin/phpmyadmin that referenced this issue Feb 7, 2021
See: phpstan/phpstan#4500

Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Author

@williamdes PHPStan 0.12.73 is out :) The inline @var support is quite reworked there, so please test it and let me know if you find any problems.

It works fine, thank you so much !
(and as I expected showed new bugs to fix ^^)
This was quick 👏

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants