You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having an error occur while trying to execute composer update. The issue appears to be from $this->symfonyDispatcher being of an incorrect type.
Steps To Reproduce
When executing composer update this error is thrown:
Symfony\Component\Console\Application::setDispatcher(): Argument #1 ($dispatcher) must be of type Symfony\Contracts\EventDispatcher\EventDispatcherInterface, Symfony\Component\EventDispatcher\EventDispatcher given, called in /home/shawn/cwUpgrade2/cw/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php on line 486
Digging into this deeper I have found that $this->symfonyDispatcher within vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php is supposed to be of type Symfony\Contracts\EventDispatcher\EventDispatcherInterface but on line 141 is defined as Symfony\Component\EventDispatcher\EventDispatcher. When the function setDispatcher() is called on line 486 this causes an error as the function is expecting the type EventDispatcherInterface.
I have attempted to understand why on starting in Laravel 10.x the function getArtisan() was updated from:
protected function getArtisan()
{
if (is_null($this->artisan)) {
$this->artisan = (new Artisan($this->app, $this->events, $this->app->version()))
->resolveCommands($this->commands)
->setContainerCommandLoader();
if ($this->symfonyDispatcher instanceof EventDispatcher) {
$this->artisan->setDispatcher($this->symfonyDispatcher);
$this->artisan->setSignalsToDispatchEvent();
}
}
return $this->artisan;
}
while on Laravel 9.x it is this:
protected function getArtisan()
{
if (is_null($this->artisan)) {
$this->artisan = (new Artisan($this->app, $this->events, $this->app->version()))
->resolveCommands($this->commands)
->setContainerCommandLoader();
}
return $this->artisan;
}
A simple workaround would be to remove that added check as it seems unnecessary.
The text was updated successfully, but these errors were encountered:
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Laravel Version
10.10
PHP Version
8.1.0
Database Driver & Version
No response
Description
I am having an error occur while trying to execute
composer update
. The issue appears to be from $this->symfonyDispatcher being of an incorrect type.Steps To Reproduce
When executing
composer update
this error is thrown:Symfony\Component\Console\Application::setDispatcher(): Argument #1 ($dispatcher) must be of type Symfony\Contracts\EventDispatcher\EventDispatcherInterface, Symfony\Component\EventDispatcher\EventDispatcher given, called in /home/shawn/cwUpgrade2/cw/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php on line 486
Digging into this deeper I have found that $this->symfonyDispatcher within vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php is supposed to be of type Symfony\Contracts\EventDispatcher\EventDispatcherInterface but on line 141 is defined as Symfony\Component\EventDispatcher\EventDispatcher. When the function setDispatcher() is called on line 486 this causes an error as the function is expecting the type EventDispatcherInterface.
I have attempted to understand why on starting in Laravel 10.x the function getArtisan() was updated from:
while on Laravel 9.x it is this:
A simple workaround would be to remove that added check as it seems unnecessary.
The text was updated successfully, but these errors were encountered: