-
-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Scoped] Symfony Polyfills are incorrectly prefixed #5617
Comments
Hi, thanks for reporting! How can we reproduce with |
Of course. I added it to the report |
There is no |
We'll need a reproducible repository on Github to solve this one |
I've updated the description and I'll try to implement a failing demo |
Thanks! |
Of course, I just wanted to keep everything in one place. |
This looks like bug in php-scoper, as the function itself is prefixed correctly: // bug
if (!\function_exists('get_debug_type')) {
function get_debug_type($value) : string
{
// correct
return \RectorPrefix20210218\Symfony\Polyfill\Php80\Php80::get_debug_type($value);
}
} There are 2 ways to fix it:
|
There is already an issue in php-scoper for this: humbug/php-scoper#440 |
Closing here then, thanks for reference |
Bug Report
I got an exception, that the function get_debug_type is not defined. I tracked it down to the symfony polyfills incorrectly being prefixed.
The only solution I found to fix this, is to whitelist all bootstrap.php files and bootstrap80.php files within the polyfills. whitelist-global-functions does not work. This might also be an issue within php-scoper itself.
Here's the polyfill for get_debug_type defined: https://github.com/rectorphp/rector-prefixed/blob/f907c6d2101d9e34d027f59a43e5efa1db76790e/vendor/symfony/polyfill-php80/bootstrap.php#L50
If rector is executed on PHP < 8.0, and get_debug_type is called (either by rector- or by vendor-code), the function is undefined due to the namespace added here.
The text was updated successfully, but these errors were encountered: