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

mark connection_status() and connection_aborted() impure #1560

Closed
wants to merge 1 commit into from

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jul 29, 2023

in chunked requests/response mode, connection status can change in flight

see e.g. sabre-io/http#207

@isfedorov
Copy link
Member

isfedorov commented Aug 18, 2023

in chunked requests/response mode, connection status can change in flight

@staabm That's why the attribute has the parameter true. This parameter means that the result of function execution can change depending on the state of the "system". Pure attribute by its own means that a function doesn't have side effects. Could you please elaborate on your change? Did you want to say that functions don't have side effects or do you want to say that functions' result can change depending on global state of "system"?

@staabm
Copy link
Contributor Author

staabm commented Aug 21, 2023

thanks for the feedback.

I am doing the PR because I wan't PHPStan to not cache the return-ed value of previous invocations as the result of the function depends on the state of the system

you want to say that functions' result can change depending on global state of "system"

if I understand correctly, PHPStan should take this parameter into account...?
I need to check whether thats already the case

@isfedorov
Copy link
Member

isfedorov commented Aug 21, 2023

@staabm

if I understand correctly, PHPStan should take this parameter into account...?

Yes, it should.

I wan't PHPStan to not cache the return-ed value of previous invocations as the result of the function depends on the state of the system

This is precisely what value true of parameter is supposed to reflect. So PhpStan should take into account parameter of Pure attribute
Also please see https://youtrack.jetbrains.com/issue/WI-59474 ticket (in scope of this ticket the parameter was introduced)

@isfedorov isfedorov closed this Aug 23, 2023
@staabm staabm deleted the patch-1 branch August 23, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants