-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Raise PHPStan level to 8 #1409
Raise PHPStan level to 8 #1409
Conversation
de7e03b
to
77fe85e
Compare
@@ -145,7 +145,7 @@ public function getConfiguration(): Configuration | |||
{ | |||
if ($this->configuration === null) { | |||
$this->configuration = $this->configurationLoader->getConfiguration(); | |||
$this->freeze(); | |||
$this->frozen = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these changes where the frozen()
method gets replaced with the direct set to true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPStan treats the method calls as impure and complains that $this->configuration
might be null
when we return it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was playing around with annotations and other configurations, but it seems like PHPStan can't be convinced that $this->freeze()
does nothing evil with other property states.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and this is fine imho. freeze()
is impure, so PHPStan's behavior is correct.
* 3.8.x: Raise PHPStan level to 8 (doctrine#1409) Remove unused paramaters from DiffCommand and VersionCommand (doctrine#1386) Simplify InlineParameterFormatterTest (doctrine#1411) fix: Allow enum param types: ArrayParameterType and ParameterType (doctrine#1408)
* 3.8.x: Raise PHPStan level to 8 (doctrine#1409) Remove unused paramaters from DiffCommand and VersionCommand (doctrine#1386) Simplify InlineParameterFormatterTest (doctrine#1411) fix: Allow enum param types: ArrayParameterType and ParameterType (doctrine#1408)
* 3.8.x: Fix CS Raise PHPStan level to 8 (doctrine#1409) Remove unused paramaters from DiffCommand and VersionCommand (doctrine#1386) Simplify InlineParameterFormatterTest (doctrine#1411) fix: Allow enum param types: ArrayParameterType and ParameterType (doctrine#1408)
Summary
Let's make our static analysis a little bit stricter.