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
Hello,
I am recently upgrading a project from Laravel 9.0 to 10.0 and have come across a strange problem regarding the getArtisan() function within vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php.
In 9.0 the code is:
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;
}
while in 10.0 it has been changed to:
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;
}
The problem occurs when $this->artisan->setDispatcher($this->symfonyDispatcher) is called as it is expecting the type EventDispatcherInterface not EventDispatcher. Is there a workaround for this or any reason why I've seem to incounter it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am recently upgrading a project from Laravel 9.0 to 10.0 and have come across a strange problem regarding the getArtisan() function within vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php.
In 9.0 the code is:
while in 10.0 it has been changed to:
The problem occurs when $this->artisan->setDispatcher($this->symfonyDispatcher) is called as it is expecting the type EventDispatcherInterface not EventDispatcher. Is there a workaround for this or any reason why I've seem to incounter it.
Thank you in advance!
All reactions