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 Collection return type in Query class template #1989

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsybenko
Copy link

@tsybenko tsybenko commented Jan 21, 2024

Fixes #1975

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8d22484) 89.28% compared to head (4ffc406) 89.28%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1989   +/-   ##
=========================================
  Coverage     89.28%   89.28%           
  Complexity     8058     8058           
=========================================
  Files           232      232           
  Lines         24534    24534           
=========================================
  Hits          21905    21905           
  Misses         2629     2629           
Flag Coverage Δ
5-max 89.28% <ø> (ø)
7.4 89.28% <ø> (ø)
agnostic 67.44% <ø> (ø)
mysql 69.83% <ø> (ø)
pgsql 69.87% <ø> (ø)
sqlite 67.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PhilinTv
Copy link
Contributor

PhilinTv commented Feb 4, 2024

Thanks @tsybenko for the PR!

Unfortunately the issue is not in the FQCN, the a wrong recognition of psalm class intersection (&), which triggers Phpstorm to recognise Collection as a magic function name 🙈

With FQCN, IDEs don't recognize this row complete, so we can use that to temporary fix it for psalm notation without losing information.

@@ -77,12 +77,12 @@
* @method <?= $modelClass ?> requireOneBy<?= $column->getPhpName() ?>(<?= $column->getPhpType() ?> $<?= $column->getName() ?>) Return the first <?= $modelClass ?> filtered by the <?= $column->getName() ?> column and throws <?= $entityNotFoundExceptionClass ?> when not found
<?php endforeach;?>
*
* @method <?= $modelClass ?>[]|Collection find(?ConnectionInterface $con = null) Return <?= $modelClass ?> objects based on current ModelCriteria
* @psalm-method Collection&\Traversable<<?= $modelClass ?>> find(?ConnectionInterface $con = null) Return <?= $modelClass ?> objects based on current ModelCriteria
* @method <?= $modelClass ?>[]|\Propel\Runtime\Collection\Collection find(?ConnectionInterface $con = null) Return <?= $modelClass ?> objects based on current ModelCriteria
Copy link
Contributor

Choose a reason for hiding this comment

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

Standard Phpdoc is fine with this notation, as there is already a declaraction above in use.
Please update only psalm.

Copy link
Contributor

@PhilinTv PhilinTv left a comment

Choose a reason for hiding this comment

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

Standard phpdoc should remain, otherwise it triggers overqualification issue in IDE.

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

Successfully merging this pull request may close these issues.

PHPStorm code inspection errors
3 participants