symfony / polyfill

PHP polyfills

Home Page:https://symfony.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

symfony/polyfill-php70 brakes Wordpress marketplace release

tatsta opened this issue · comments

Dear,
We are using php-http/guzzle6-adapter version 1.1.1 in our project, that has symfony/polyfill-intl-idn as a transitive dependency. There was a release v1.18.0 that included symfony/polyfill-php70 into dependencies. This is breaking our release process to Wordpress marketplace, since it has a PHP lint check to allow the plugin to be released.

2020-07-20T08:31:55.8839337Z svn: E165001: Commit failed (details follow): 2020-07-20T08:31:55.8840489Z svn: E165001: Commit blocked by pre-commit hook (exit code 1) with output: 2020-07-20T08:31:55.8840604Z 2020-07-20T08:31:55.8840756Z *********************************** 2020-07-20T08:31:55.8841432Z PHP error in: ***-woocommerce-extension/tags/3.3.3/vendor/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php: 2020-07-20T08:31:55.8841568Z 2020-07-20T08:31:55.8841763Z Fatal error: Cannot declare class ArithmeticError, because the name is already in use in Standard input code on line 5 2020-07-20T08:31:55.8842092Z Errors parsing Standard input code 2020-07-20T08:31:55.8842252Z ***********************************

Is this issue known to you? Are there any actions to be taken to fix this?
We would appreciate any support.

Hi @tatsta, thanks for reporting this issue. The problem was discussed in #145. Please note that stubs will not be autoloaded if the class already exists in PHP core.

You may try to lock symfony/polyfill-intl-idn on previous version or bump your plugin's PHP version to 7.0 and add symfony/polyfill-php70 to composer.json's replaces as a temporary solution.

Closing as explained. This is an issue with the class loading logic, not with the polyfill itself.

I added a workaround (and instructions) in this gist. Apply that patch to your svn branch to fix the issue! (via @jdeniau)