Closed giovannialbero1992 closed 4 years ago
Thanks for reporting, the reproducible test case is really great
Also reported in issue #503
Can confirm this issue we have a mock of our StructureMetadata which implements PropertiesMetadata and now fails with:
PHP Fatal error: Declaration of Double\Sulu\Component\Content\Metadata\StructureMetadata\P23::setResource(string > $resource): Sulu\Component\Content\Metadata\StructureMetadata must be compatible with Sulu\Component\Content> \Metadata\PropertiesMetadata::setResource(string $resource): Sulu\Component\Content\Metadata\PropertiesMetadata in > C:\projects\sulu\vendor\phpspec\prophecy\src\Prophecy\Doubler\Generator\ClassCreator.php(49) : eval()'d code on line 2
Yes we're generating the return type wrongly (we are basically behaving as if it's static
) but this is allowed via PHP 7.4's type widening, which is why it's only failing on older versions.
Need to see how the old code coped with it (without a test case) and port the logic over.
Thanks @giovannialbero1992 I've moved your commits to #504 and think it's fixed there
I have this behavior with the new minor version, maybe is a bug.
When I do a prophecy of an extended class that inherits a method with
self
return type I've this error:This error is raised into PHP versions <=7.3