-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix issues reported by PHPStan #1334 #1370
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
Fix issues reported by PHPStan #1334 #1370
Conversation
It would be interesting to review this PR after being updated to Symfony 6.2. |
We've merged the PR that upgrades to 6.2. If you can, please rebase this PR. Thanks! |
At the moment we’ve got 1 error:
The |
That is fixed by #1372 |
Krzysztof, what an amazing contribution you did here! Thanks a lot for taking the time to fix all these type issues and for tweaking/improving the rest of the code. An outstanding first contribution to the project. Thanks! |
@@ -159,8 +163,12 @@ public function testAdminEditPost(): void | |||
|
|||
$this->assertResponseRedirects('/en/admin/post/1/edit', Response::HTTP_FOUND); | |||
|
|||
/** @var PostRepository $postRepository */ | |||
$postRepository = static::getContainer()->get(PostRepository::class); | |||
|
|||
/** @var \App\Entity\Post $post */ |
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.
smae here. The types on PostRepository allow inferring that variable
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.
After removal of this PHPDoc new entry is added to baseline:
-
message: "#^Cannot call method getTitle\\(\\) on App\\\\Entity\\\\Post\\|null\\.$#"
count: 1
path: tests/Controller/Admin/BlogControllerTest.php
So do we need more entries in baseline or PHPDoc here?
Closes #1334