Fatal error: Method [email protected]::__toString() must not throw an exception after composer install

  Uncategorized

hello I have an error when I do a composer install and which does cache: clear

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!  
!!  Fatal error: Method [email protected]::__toString() must not throw an exception, caught SymfonyComponentDependencyInjectionExceptionAutowiringFailedException:  in /var/www/symfony/vendor/symfony/dependency-injection/Compiler/AutowirePass.php on line 236
!!  
!!  Call Stack:
!!      0.0007     403504   1. {main}() /var/www/symfony/bin/console:0
!!      0.1237    2144656   2. SymfonyBundleFrameworkBundleConsoleApplication->run($input = class SymfonyComponentConsoleInputArgvInput { private $tokens = [0 => '--ansi', 1 => 'cache:clear']; private $parsed = NULL; protected $definition = class SymfonyComponentConsoleInputInputDefinition { private $arguments = [...]; private $requiredCount = 0; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = []; protected $interactive = TRUE }, $output = ???) /var/www/symfony/bin/console:39
!!      0.1621    2388728   3. SymfonyBundleFrameworkBundleConsoleApplication->doRun($input = class SymfonyComponentConsoleInputArgvInput { private $tokens = [0 => '--ansi', 1 => 'cache:clear']; private $parsed = NULL; protected $definition = class SymfonyComponentConsoleInputInputDefinition { private $arguments = [...]; private $requiredCount = 0; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = []; protected $interactive = TRUE }, $output = class SymfonyComponentConsoleOutputConsoleOutput { private $stderr = class SymfonyComponentConsoleOutputStreamOutput { private $stream = resource(86) of type (stream); private ${SymfonyComponentConsoleOutputOutput}verbosity = 32; private ${SymfonyComponentConsoleOutputOutput}formatter = class SymfonyComponentConsoleFormatterOutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${SymfonyComponentConsoleOutputStreamOutput}stream = resource(79) of type (stream); private ${SymfonyComponentConsoleOutputOutput}verbosity = 32; private ${SymfonyComponentConsoleOutputOutput}formatter = class SymfonyComponentConsoleFormatterOutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class SymfonyComponentConsoleFormatterOutputFormatterStyleStack { ... } } }) /var/www/symfony/vendor/symfony/console/Application.php:149
!!      0.1622    2388728   4. SymfonyBundleFrameworkBundleConsoleApplication->registerCommands() /var/www/symfony/vendor/symfony/framework-bundle/Console/Application.php:75
!!      0.1622    2388728   5. AppKernel->boot() /var/www/symfony/vendor/symfony/framework-bundle/Console/Application.php:169
!!      0.3126    4035304   6. AppKernel->initializeContainer() /var/www/symfony/vendor/symfony/http-kernel/Kernel.php:136
!!      1.2879   11308488   7. SymfonyComponentDependencyInjectionContainerBuilder->compile($resolveEnvPlaceholders = ???) /var/www/symfony/vendor/symfony/http-kernel/Kernel.php:596
[...]
!!  
!!  
!!  In AutowirePass.php line 236:
!!                                                                                 
!!    Error: Method [email protected]::__toString() must not throw an exception, ca  
!!    ught SymfonyComponentDependencyInjectionExceptionAutowiringFailedExcept  
!!    ion:                                                                         
!!                                                                                 
!!  
!!  
Script @auto-scripts was called via post-update-cmd
  • I use Symfony 4.1
  • I already delete /var & /vendor

I tried to follow this issue but nothing works (not work in develop for me)

Source: Composer php

LEAVE A COMMENT