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 1.9.1 #5807

Merged
merged 1 commit into from
Nov 4, 2022
Merged

PHPStan 1.9.1 #5807

merged 1 commit into from
Nov 4, 2022

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Nov 3, 2022

No description provided.

@derrabus derrabus added this to the 3.5.2 milestone Nov 3, 2022
@@ -163,7 +163,6 @@ class Connection
* @param Configuration|null $config The configuration, optional.
* @param EventManager|null $eventManager The event manager, optional.
* @psalm-param Params $params
* @phpstan-param array<string,mixed> $params
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPStan fully understands our Params type now, so we can have it analyze the @psalm-param annotation.

Comment on lines 303 to 305
if ($url === null) {
throw new LogicException(preg_last_error_msg(), preg_last_error());
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confident that this case never happens because the regular expressions are analyzed by PHPStan already. But apparently, it is desired that we perform an explicit null check here. See phpstan/phpstan#1901 (comment) for a discussion on this topic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even when I manage to get a Process exited with code 137., there will be a string as a return type. I don't know if an evil regex could end up in a return null after some runtime, but I don't see one in our use case. I guess we can live with a null check, but if you're sure about not-null, then maybe an assert is sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, let's go with an assert.

@derrabus derrabus changed the title PHPStan 1.9.0 PHPStan 1.9.1 Nov 4, 2022
@derrabus derrabus merged commit 0fbb1f2 into doctrine:3.5.x Nov 4, 2022
@derrabus derrabus deleted the bump/phpstan branch November 4, 2022 22:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants