Skip to content

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

Merged
merged 1 commit into from
Dec 2, 2022
Merged

Fix issues reported by PHPStan #1334 #1370

merged 1 commit into from
Dec 2, 2022

Conversation

kniziol
Copy link
Contributor

@kniziol kniziol commented Nov 20, 2022

Closes #1334

@seb-jean
Copy link
Contributor

It would be interesting to review this PR after being updated to Symfony 6.2.

@javiereguiluz
Copy link
Member

We've merged the PR that upgrades to 6.2. If you can, please rebase this PR. Thanks!

@kniziol
Copy link
Contributor Author

kniziol commented Dec 1, 2022

At the moment we’ve got 1 error:

require.doctrine/doctrine-bundle : exact version constraints (2.7.x-dev) should be avoided if the package follows semantic versioning

The doctrine/doctrine-bundle package has been bumped to 2.7.x-dev in 1c9ca01. Could we use another version?

@rosier
Copy link
Contributor

rosier commented Dec 1, 2022

That is fixed by #1372

@javiereguiluz
Copy link
Member

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!

@javiereguiluz javiereguiluz merged commit 6511204 into symfony:main Dec 2, 2022
@@ -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 */
Copy link
Member

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

Copy link
Contributor Author

@kniziol kniziol Dec 3, 2022

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?

@kniziol
Copy link
Contributor Author

kniziol commented Dec 3, 2022

@stof I’ve applied all suggestions in #1374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix issues reported by PHPStan
5 participants