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: PHPDoc @template and @return in database #7436

Merged
merged 5 commits into from May 4, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Apr 14, 2023

Description
To fix this error: codeigniter4/shield#195 (comment)

It seems Psalm does not allow to use resource in @template type.
See

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

Comment on lines 16 to 19
/**
* @template TConnection of object|resource
* @template TResult of object|resource
*/
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed TConnection and TResult because they are not used in this interface.
@paulbalandan Are you okay?

Copy link
Member

Choose a reason for hiding this comment

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

I think I added those template types to help phpstan think that the interface is a generic and thus implementing classes should specify the specific types.

Copy link
Member Author

Choose a reason for hiding this comment

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

Restored @template without types, because of vimeo/psalm#2625

@kenjis kenjis merged commit 824ca83 into codeigniter4:develop May 4, 2023
51 checks passed
@kenjis kenjis deleted the fix-phpdoc-types-database branch May 4, 2023 00:17
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.

None yet

3 participants