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
Prevent allowing direct call to __construct #118
Comments
I'm happy to give this a go at providing an implementation in the next few days. |
@DaveLiddament shouldn't be detected by conding-standard checker than static-analyzer? |
@mavimo If you’re concerned about semantics and not code formatting, it’s always easier to write the rule using PHPStan’s AST and type inference. I’d consider this for phpstan-strict-rules, thank you. |
I guess this is now in PHPStan itself with this PR. |
Yes. It's gonna be in bleedingEdge in 1.6.0. Based on feedback I might move it to phpstan-strict-rules before 2.0 comes out. |
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. |
Feature request
I don't think code should be allowed to call
__construct
method.E.g.
$bob->__construct("Jane");
https://phpstan.org/r/e261ee44-70c1-486b-958e-dc8abc1231d9
The text was updated successfully, but these errors were encountered: