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

PHPStan doesn't recognize class properties within a declare_tick() block #10059

Closed
jeroenvdgulik opened this issue Oct 27, 2023 · 4 comments
Closed

Comments

@jeroenvdgulik
Copy link

Bug report

When declaring a declare() block, phpstan loses references to class property instances. (See added snippet)

Code snippet that reproduces the problem

https://phpstan.org/r/0f14ff7b-ee3a-4273-a475-d7653f44517d

Expected output

Expected error is " No Errors" see snippet

https://phpstan.org/r/4b53a9d4-def4-403b-b942-6c06b3285eac

Did PHPStan help you today? Did it make you happy in any way?

Love your work Ondrej

@ondrejmirtes
Copy link
Member

Hello, what is your reason to use declare(ticks=5) in your code?

@jeroenvdgulik
Copy link
Author

It's for a long running process to send keep-alive so the connection doesn't time out

@ondrejmirtes
Copy link
Member

Fixed, thank you! phpstan/phpstan-src@eb39381

Copy link

github-actions bot commented Dec 1, 2023

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 Dec 1, 2023
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

2 participants