Skip to content

Fix TEntity generic #524

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

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open

Conversation

rincler
Copy link

@rincler rincler commented May 15, 2025

Closes #520

@rincler
Copy link
Author

rincler commented May 16, 2025

@template TEntity of object

doesn't work for \Cycle\ORM\Iterator :(

Psalm emits the issues:

<file name="src/Iterator.php">
 <error line="123" column="16" severity="error" message="MixedReturnStatement: Could not infer a return type"/>
</file>
<file name="src/Relation/ManyToMany.php">
 <error line="148" column="24" severity="error" message="InvalidArgument: Argument 1 of SplObjectStorage::offsetSet expects never, but array-key|object provided"/>
</file>
<file name="src/Relation/ManyToMany.php">
 <error line="148" column="24" severity="error" message="InvalidArgument: Argument 1 of SplObjectStorage::offsetGet expects never, but array-key|object provided"/>
</file>
<file name="src/Relation/ManyToMany.php">
 <error line="[31](https://github.com/rincler/orm/actions/runs/15075752236/job/42382664586#step:11:32)9" column="24" severity="error" message="InvalidArgument: Argument 1 of SplObjectStorage::offsetSet expects never, but array-key|object provided"/>
</file>
<file name="src/Relation/ManyToMany.php">
 <error line="319" column="24" severity="error" message="InvalidArgument: Argument 1 of SplObjectStorage::offsetGet expects never, but array-key|object provided"/>
</file>
<file name="src/Select.php">
 <error line="395" column="16" severity="error" message="InvalidReturnType: The declared return type &apos;Cycle\ORM\Iterator&lt;TEntity:Cycle\ORM\Select as object&gt;&apos; for Cycle\ORM\Select::getIterator is incorrect, got &apos;Cycle\ORM\Iterator&apos;"/>
</file>
<file name="src/Select.php">
 <error line="[40](https://github.com/rincler/orm/actions/runs/15075752236/job/42382664586#step:11:41)2" column="16" severity="error" message="InvalidReturnStatement: The inferred type &apos;Cycle\ORM\Iterator&apos; does not match the declared return type &apos;Cycle\ORM\Iterator&lt;TEntity:Cycle\ORM\Select as object&gt;&apos; for Cycle\ORM\Select::getIterator"/>
</file>

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.

Minor: RepositoryInterface generic
1 participant