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

Fix psalm errors #113

Merged
merged 3 commits into from
Jan 24, 2022
Merged

Fix psalm errors #113

merged 3 commits into from
Jan 24, 2022

Conversation

lruozzi9
Copy link
Member

These changes will solve psalm errors in test action. One is due to the deprecation of method get inside a Controller which extends the AbstractController from Symfony. The new suggested method is to manually pass the service from the constructor of the class. So, to avoid a BC break, a new deprecation has been added.

@@ -75,13 +97,13 @@ public function enqueueAction(int $productId): Response
foreach ($alreadyEnqueued as $code) {
$this->addFlash(
'error',
$translator->trans('webgriffe_sylius_akeneo.ui.product_already_enqueued', ['code' => $code])
$this->translator->trans('webgriffe_sylius_akeneo.ui.product_already_enqueued', ['code' => $code]) // @phpstan-ignore-line
Copy link
Member

Choose a reason for hiding this comment

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

The // @phpstan-ignore-line is necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

For phpstan here the translator property can be null, but it is impossible because it's always instantiated.

Copy link
Member

Choose a reason for hiding this comment

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

I supposed so. That's probably a bug on phpstan

@LucaGallinari LucaGallinari self-requested a review January 18, 2022 08:53
@lruozzi9 lruozzi9 merged commit aef29fc into master Jan 24, 2022
@lruozzi9 lruozzi9 deleted the fix-psalm branch March 14, 2022 10:52
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.

2 participants