zenstruck / messenger-test

Assertions and helpers for testing your symfony/messenger queues.
MIT License
218 stars 15 forks source link

Psalm errors since v1.7.0 #59

Closed svianney closed 1 year ago

svianney commented 1 year ago

Hi, we've upgraded to version 1.7.0 and we now have some psalm errors like Method Zenstruck\Messenger\Test\EnvelopeCollection::back does not exist caused by the fact that methods in EnvelopeCollecion returns self instead of static. Can you please fix this ? I believe we have the same kind of behavior on proxy object and methods like refresh. We implemented code stubs in our code to bypass the errors but if we could have a fix that would be awesome.

Thanks for reading me.

I'd be happy to open a PR when I have more time.

flohw commented 1 year ago

Hi @svianney ,

I may be responsible for this error. :grimacing:

@kbond @nikophil I can provide a pr today based only on what's stated here but I have no clue if there is a test to update. I don't use psalm enough for now to know the best way to handle this.

Thanks.

nikophil commented 1 year ago

Hi!

@svianney I'm not sure to understand this, could you elaborate, please?

believe we have the same kind of behavior on proxy object and methods like refresh

@flohw, as mentionned by @svianney the fix is indeed to replace all : self by : static in EnvelopeCollection

That would be cool if you make these methods final as well

thanks :)

kbond commented 1 year ago

Released 1.7.1 with the fix.

nikophil commented 1 year ago

@kbond there was two problems in this issue: one was resolved by #60

the second was:

I believe we have the same kind of behavior on proxy object and methods like refresh. We implemented code stubs in our code to bypass the errors but if we could have a fix that would be awesome.

but I'm wondering if this does not concern Foundry :thinking:

svianney commented 1 year ago

Sorry for the late response, we didn't check the fix yet but big thank you for your reactivity guys ! And yes @nikophil you are right, the Proxy object concerns Foundry, It didn't occured to me when I wrote this issue though :sweat_smile: I assume you finally understood what I meant and I don't have to elaborate ?

kbond commented 1 year ago

I think we're all good here but let us know if the latest release doesn't fix your psalm issue with this package.