phpsymfonysymfony5

Compile Error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record): bool must be compatible


I am upgrading symfony 4.4 to 5.4 using PHP 8.2 after run composer update command then i am facing this issue.

ERROR: Compile Error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record): bool must be compatible with Monolog\Handler\AbstractProcessingHandler::handle(Monolog\LogRecord $record): bool

PHP 8.0 & Symfony 4.4 composer.json file that is fine but I must have to upgrade PHP as well symfony version.

Upgraded Composer.json for PHP 8.2 & Symfony 5.4:

Result of composer update -W

ERROR: Compile Error: Declaration of Model\Base\Account::isPrimaryKeyNull() must be compatible with Propel\Runtime\ActiveRecord\ActiveRecordInterface::isPrimaryKeyNull(): bool

Solution

  • Neither in Monolog v1 nor in Monolog v2, Monolog\Handler\AbstractProcessingHandler::handle has the given signature. This is part of Monolog v3, but symfony/monolog-bridge in v5.4 is not compatible with that package.

    Please check how you installed the MonologBridge. Requiring 3.x-dev of the MonologBundle is not a good idea after all, as this does not target a tagged (and thus stable) version