phpspec / prophecy

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

Declaration of Double unserialize() is not compatible with mocked class #438

Open rodrigodiez opened 5 years ago

rodrigodiez commented 5 years ago

I am trying to mock an instance of Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken which, since Symfony 4.3 requires an array as a parameter for its unserialize method. commit

When running phpspec I get the following message:

PHP Fatal error:  Declaration of Double\Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken\P711::__unserialize() must be compatible with Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken::__unserialize(array $data): void in /var/www/html/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php(49) : eval()'d code on line 2