psalm / psalm-plugin-doctrine

Stubs to let Psalm understand Doctrine better
86 stars 43 forks source link

Add a stub for `Criteria` #125

Open fluffycondor opened 2 years ago

fluffycondor commented 2 years ago

Huh, I'm confused by this: Cannot call a non-mutation-free method Doctrine\Common\Collections\Criteria::orderBy from a pure context I've marked this method as @psalm-external-mutation-free because it mutates its own state only. The object is created inside the pure function and never will be user outside of it. Shouldn't @psalm-external-mutation-free be sufficient here? I don't understand how to fix it.

AndrolGenhald commented 2 years ago

Sounds like vimeo/psalm#5615 to me, I'd just suppress it for now.

Edit: Wait, looks like this is going to happen for callers? Well, that's not so good. Maybe we really need to fix that in Psalm.