phpspec / prophecy

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

PHP 8.2 issue in DisableConstructorPatch #555

Closed lolli42 closed 5 months ago

lolli42 commented 2 years ago
        $constructor->setCode(<<<PHP
if (0 < func_num_args()) {
    call_user_func_array(array('parent', '__construct'), func_get_args());
}
PHP
        );

This raises Use of "parent" in callables is deprecated E_DEPRECATED due to https://wiki.php.net/rfc/deprecate_partially_supported_callables .

ciaranmcnulty commented 2 years ago

Thanks for reporting; I guess we'll have to use the real class name?

gilbertsoft commented 2 years ago

useParentCode() does exactly what should be done here.

stof commented 2 years ago

Can you send a PR with the fix ?

TalalM commented 5 months ago

Hello,

What's the status of this fix? I am moving my project to PHP 8.2 and my tests are failing now because of this error.

Will this be fixed, or is there a way for me to make my tests pass?

Thanks,

stof commented 5 months ago

I just merged #614 which provided a fix.

TalalM commented 5 months ago

OK thank you.

Do you know when is the next release, in which the fix will be available?