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
Implement @phpstan-allow-private-mutation #1610
Implement @phpstan-allow-private-mutation #1610
Conversation
|
src/PhpDoc/ResolvedPhpDocBlock.php
Outdated
// skip $result->phpDocNodeResolver | ||
if (isset($this->phpDocNodeResolver)) { | ||
$result->phpDocNodeResolver = $this->phpDocNodeResolver; | ||
} |
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.
Error: Property PHPStan\PhpDoc\ResolvedPhpDocBlock::$phpDocNode (PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode) in isset() is not nullable.
Error: Property PHPStan\PhpDoc\ResolvedPhpDocBlock::$phpDocNodeResolver (PHPStan\PhpDoc\PhpDocNodeResolver) in isset() is not nullable.
------ ------------------------------------------------------------------
Line src/PhpDoc/ResolvedPhpDocBlock.php
------ ------------------------------------------------------------------
225 Property PHPStan\PhpDoc\ResolvedPhpDocBlock::$phpDocNode
(PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode) in isset() is not
nullable.
[24](https://github.com/phpstan/phpstan-src/actions/runs/3044344145/jobs/4904629542#step:11:25)3 Property PHPStan\PhpDoc\ResolvedPhpDocBlock::$phpDocNodeResolver
(PHPStan\PhpDoc\PhpDocNodeResolver) in isset() is not nullable.
------ ------------------------------------------------------------------
https://github.com/phpstan/phpstan-src/actions/runs/3044344145/jobs/4904629542#step:11:9
@ondrejmirtes Could you please review this PR? |
src/PhpDoc/ResolvedPhpDocBlock.php
Outdated
@@ -192,7 +198,9 @@ public function merge(array $parents, array $parentPhpDocBlocks): self | |||
// skip $result->nameScope | |||
$result->templateTypeMap = $this->templateTypeMap; | |||
$result->templateTags = $this->templateTags; | |||
// skip $result->phpDocNodeResolver | |||
if (isset($this->phpDocNodeResolver)) { | |||
$result->phpDocNodeResolver = $this->phpDocNodeResolver; |
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.
Hi, you¨re adding a simple boolean value which there are already many present. These changes to phpDocNode and phpDocNodeResolver are not required to make this work, and cause these build failures.
If the PR doesn't work without these changes, please observe how different boolean values are handled here, it shouldn't be hard to make them work.
Sorry, I accidentally submitted a re-review. Ignore it for once. |
I've updated the PR with the correct fix. |
Thank you. |
resolve phpstan/phpstan#7778, refs #1609