phpspec / prophecy

Highly opinionated mocking framework for PHP 5.3+
MIT License
8.53k stars 241 forks source link

Add generic types for ObjectProphecy #574

Closed stof closed 1 year ago

stof commented 1 year ago

Closes #544

ciaranmcnulty commented 1 year ago

This looks cool but without tests/validation I find it hard to review ;) If we merge it 'wrong' will it break things for anyone?

Wirone commented 1 year ago

If one is using PHPStan with jangregor/phpstan-prophecy, it probably will have priority over "native" annotations within library. I'm not sure about scenario where PHPStan is used without this plugin and there are errors in the baseline - then it depends on reportUnmatchedIgnoredErrors flag. Even if it's enabled, then all that has to be done is regenerating baseline.

stof commented 1 year ago

@Wirone the goal is that a next version of jangregor/phpstan-prophecy removes its stub to rely on the built-in annotations instead. The extension would only have to deal with the magic API.