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

Please mark Builder methods @pure to ease understanding that it's immutable #1075

Closed
b1rdex opened this issue Nov 4, 2024 · 2 comments · Fixed by #1076
Closed

Please mark Builder methods @pure to ease understanding that it's immutable #1075

b1rdex opened this issue Nov 4, 2024 · 2 comments · Fixed by #1076
Labels
Milestone

Comments

@b1rdex
Copy link
Contributor

b1rdex commented Nov 4, 2024

After upgrading to v5, I spent some time figuring out why the code broke, but this wasn't detected by PHPStan or any other tool.

After some tests, I found out that the reason is making the Builder immutable (#979) in the version.

Please consider marking the methods @pure, so SCA can report that 'the result is not used'.

Rule check example: https://phpstan.org/r/f638ba16-0ab3-44e2-becd-2927e99ada09

@Slamdunk Slamdunk added the Bug label Nov 4, 2024
@Slamdunk
Copy link
Collaborator

Slamdunk commented Nov 4, 2024

Thank you for your rightful complaint: could you please send a PR to fix this?

@b1rdex
Copy link
Contributor Author

b1rdex commented Nov 4, 2024

@Slamdunk done: #1076

@lcobucci lcobucci added this to the 5.4.1 milestone Nov 5, 2024
@lcobucci lcobucci closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants