Updating symfony/flex fails

398 views Asked by At

When I ran 'composer install' (with --ignore-platform-reqs) I met with the error

In ParallelDownloader.php line 212:

  Declaration of Symfony\Flex\ParallelDownloader::getRemoteContents($originUrl, $fileUrl, $context) should be compatible with Compos
  er\Util\RemoteFilesystem::getRemoteContents($originUrl, $fileUrl, $context, ?array &$responseHeaders = NULL)

I asked google and found out that (for obvious reasons) I had to update flex but when I did composer update symfony/flex --no-plugins --no-scripts I met with the same error, what should I do?

(The error in the question led me to this page: https://github.com/symfony/flex/issues/397)

1

There are 1 answers

0
phperson On

For thoose wondering, I had to follow this guide to fix the error, I lost the resource so I'd be really happy if somebody links to it:

If you got symfony/flex package installed and are still getting the error, 
make sure the symfony/flex package is allowed to execute code when running 
composer.

This is because since Composer 2.2.0 the allow-plugins option adds a layer 
of security that allows you to restrict which Composer plugins can execute 
code at startup time.

So make sure you have the appropriate line in the allow-plugins config in 
your composer.json file

"config": { 
// other config...

"allow-plugins": {
    "symfony/flex": true
 }
}