phpspec / prophecy

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

Initial compatability support for PHP8.2 for readonly classes. #564

Closed kschatzle closed 1 year ago

kschatzle commented 1 year ago

readonly classes will throw a ClassMirrorException until supported.

ciaranmcnulty commented 1 year ago

What's the error currently when we try and extend readonly classes?

kschatzle commented 1 year ago

What's the error currently when we try and extend readonly classes?

PHP Fatal error:  Non-readonly class Double\Fixtures\Prophecy\ReadOnlyClass\P1 cannot extend readonly class Fixtures\Prophecy\ReadOnlyClass in %s/src/Prophecy/Doubler/Generator/ClassCreator.php(49) : eval()'d code on line 2
gquemener commented 1 year ago

I have pushed a patch to support doubling readonly class. It's available through this PR: https://github.com/phpspec/prophecy/pull/571

Would there be a mean of communication (chat/mailing list) to coordinate efforts around supporting 8.2? I'd gladly help, however don't want to create noise if you have already defined a strategy (first convert fatal error into proper exception, then support feature one by one, for instance).

ciaranmcnulty commented 1 year ago

Thanks for the effort, I've merged #571 so this is not needed

ciaranmcnulty commented 1 year ago

@gquemener on the subject of coordination I'd prefer Issues here