Skip to content

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

@kenjis kenjis force-pushed the fix-phpdoc-types-database branch from 8e34b8a to f6f5508 Compare April 25, 2023 00:24
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 force-pushed the fix-phpdoc-types-database branch from f6f5508 to a7a2369 Compare April 30, 2023 02:37
@kenjis kenjis force-pushed the fix-phpdoc-types-database branch from a7a2369 to 377ef3d Compare April 30, 2023 02:40
@kenjis kenjis requested review from MGatner and paulbalandan April 30, 2023 02:42
@kenjis kenjis merged commit 824ca83 into codeigniter4:develop May 4, 2023
@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.

3 participants