composer-unused: Declaration of Symfony\Component\Console\Style\OutputStyle::write() is incompatible

Composer v2.0.10 is bundled with symfony/console where declaration of Symfony\Component\Console\Style\OutputStyle is

public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)

while in my app is

public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL)

It somehow causes composer unused to crash

Reading ./composer.json (/Users/user/project/composer.json)
Loading config file /Users/user/.composer/auth.json
Loading config file ./composer.json (/Users/user/project/composer.json)
Checked CA file /usr/local/etc/openssl@1.1/cert.pem: valid
Executing command (/Users/user/project): git branch -a --no-color --no-abbrev -v
Executing command (/Users/user/project): git rev-list master..composer
Executing command (/Users/user/project): git rev-list remotes/origin/master..composer
Reading /Users/user/.composer/composer.json
Loading config file /Users/user/.composer/auth.json
Loading config file /Users/user/.composer/composer.json (/Users/user/.composer/composer.json)
Loading config file /Users/user/.composer/auth.json
Reading /Users/user/.composer/auth.json
Reading /Users/user/project/vendor/composer/installed.json
Loading plugin Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin
Loading plugin PHPStan\ExtensionInstaller\Plugin
Loading plugin Roave\YouAreUsingItWrong\Hook
Loading plugin Icanhazstring\Composer\Unused\UnusedPlugin
Running 2.0.10 (2021-02-23 16:11:37) with PHP 7.4.15 on Darwin / 20.3.0
PHP Fatal error:  Declaration of Symfony\Component\Console\Style\OutputStyle::write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) must be compatible with Symfony\Component\Console\Output\OutputInterface::write($messages, $newline = false, $options = 0) in /Users/user/project/vendor/symfony/console/Style/OutputStyle.php on line 52

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19 (12 by maintainers)

Most upvoted comments

@icanhazstring yes. unused is up and running in CI again 🚀

Ok Composer 2.0.11 is out and reverts the change entirely so hopefully that fixes things.

Ok thanks. Let me check what I can do about it 😃