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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bye Psalm 馃憢馃徏 #15582
Bye Psalm 馃憢馃徏 #15582
Conversation
Bunnyshell Preview Environment deletedAvailable commands:
|
f67df6e
to
7b7c5c3
Compare
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.
So Long, Psalm, and Thanks for All the Fish 馃槃
* @return Collection|ImageInterface[] | ||
* | ||
* @psalm-return Collection<array-key, ImageInterface> | ||
* @return Collection<array-key, ImageInterface> |
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.
* @return Collection<array-key, ImageInterface> | |
* @return Collection<array-key, ProductImageInterface> |
* @return Collection|ImageInterface[] | ||
* | ||
* @psalm-return Collection<array-key, ImageInterface> | ||
* @return Collection<array-key, ImageInterface> |
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.
* @return Collection<array-key, ImageInterface> | |
* @return Collection<array-key, ProductImageInterface> |
* @return Collection|CountryInterface[] | ||
* | ||
* @psalm-return Collection<array-key, CountryInterface> | ||
* @return Collection<array-key, CountryInterface> |
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.
return
s so far using multi-line syntax, is it possible to convert them to single line as well?
/** | ||
* @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 | ||
* @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 | ||
*/ | ||
public function getImagesByType(string $type): Collection | ||
{ | ||
/** @var Collection<array-key, ImageInterface> $imagesByType */ |
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.
This docblock shouldn't be needed anymore.
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.
On line 297
, Assert::allIsInstanceOf($imagesByType, ImageInterface::class);
does look needed.
/** | ||
* @psalm-suppress InvalidReturnType https://github.com/doctrine/collections/pull/220 | ||
* @psalm-suppress InvalidReturnStatement https://github.com/doctrine/collections/pull/220 | ||
*/ | ||
public function getImages(): Collection | ||
{ | ||
/** @phpstan-ignore-next-line */ |
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.
If ProductImagesAwareInterface
docblocks would be fixed from ImageInterface
to ProductImageInterface
, then this ignore is probably won't be needed anymore.
* | ||
* @psalm-var Collection<array-key, ImageInterface> | ||
*/ | ||
/** @var Collection<array-key, ImageInterface> */ |
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.
/** @var Collection<array-key, ImageInterface> */ | |
/** @var Collection<array-key, TaxonImageInterface> */ |
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.
Line 36
/** @var ArrayCollection<array-key, ImageInterface> $this->images */
$this->images = new ArrayCollection();
Could those docblocks be merged somehow?
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.
--- return $this->images->filter(function (ImageInterface $image) use ($type): bool {
+++ return $this->images->filter(function (TaxonImageInterface $image) use ($type): bool {
Can we change this without breaking BC?
* | ||
* @psalm-var Collection<array-key, ProductAssociationInterface> | ||
*/ | ||
/** @var Collection<array-key, ProductAssociationInterface> */ |
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.
Can those docblocks be merged somehow?
/** @var ArrayCollection<array-key, AttributeValueInterface> $this->attributes */
$this->attributes = new ArrayCollection();
/** @var ArrayCollection<array-key, ProductAssociationInterface> $this->associations */
$this->associations = new ArrayCollection();
/** @var ArrayCollection<array-key, ProductVariantInterface> $this->variants */
$this->variants = new ArrayCollection();
/** @var ArrayCollection<array-key, ProductOptionInterface> $this->options */
$this->options = new ArrayCollection();
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.
If yes, then it's actual for the rest of entities with collections as well, though it's probably outside of current PR scope.
* | ||
* @psalm-var Collection<array-key, CatalogPromotionScopeInterface> | ||
*/ | ||
/** @var Collection<array-key, CatalogPromotionScopeInterface> */ | ||
protected Collection $scopes; | ||
|
||
protected Collection $actions; |
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.
Needs array shape as well?
src/Sylius/Component/Shipping/Checker/ShippingMethodEligibilityChecker.php
Outdated
Show resolved
Hide resolved
src/Sylius/Component/Channel/Context/CompositeChannelContext.php
Outdated
Show resolved
Hide resolved
...ylius/Bundle/ProductBundle/Form/DataTransformer/ProductsToProductAssociationsTransformer.php
Outdated
Show resolved
Hide resolved
7b7c5c3
to
a8516f5
Compare
a8516f5
to
7ece672
Compare
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.
@diimpp
We'll go over the leftover missing @var
's, probably using some automated tool since it's tedious; for now I'm merging it as is just to get rid of psalm 馃拑
Thank you, @jakubtobiasz! |
This PR was merged into the 1.5 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | no | New feature? | no | Related tickets | Sylius/Sylius#15582 Commits ------- [Composer] Remove Psalm [Psalm] Remove configuration file [Psalm] Remove outdated annotations
Justification
Core Team Voting result:
6 votes for keeping only PHPStan
1 vote for keeping only Psalm
1 vote for keeping both
2 votes for keeping any but only one
I was wondering whether we should target it against
1.12
or1.13
, but as it's not a hard dependency, and we still maintain1.12
, I decided to pick this one.