Skip to content

Commit

Permalink
fix(phpstan): code analysis
Browse files Browse the repository at this point in the history
Signed-off-by: Sami Mazouz <[email protected]>
  • Loading branch information
SychO9 committed Jul 27, 2023
1 parent 7467beb commit 608e2a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 2 additions & 4 deletions framework/core/src/Console/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Flarum\Foundation\SiteInterface;
use Illuminate\Console\Events\CommandFinished;
use Illuminate\Console\Events\CommandStarting;
use Illuminate\Container\Container;
use Illuminate\Contracts\Container\Container;
use Illuminate\Events\Dispatcher;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\ConsoleEvents;
Expand Down Expand Up @@ -65,9 +65,7 @@ private function handleEvents(Application $console, Container $container): void
);
});

$dispatcher->addListener(ConsoleEvents::ERROR, function (ConsoleErrorEvent $event) {
$container = Container::getInstance();

$dispatcher->addListener(ConsoleEvents::ERROR, function (ConsoleErrorEvent $event) use ($container) {
/** @var Registry $registry */
$registry = $container->make(Registry::class);
$error = $registry->handle($event->getError());
Expand Down
3 changes: 3 additions & 0 deletions framework/core/src/Foundation/AppInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@

namespace Flarum\Foundation;

use Illuminate\Contracts\Container\Container;
use Psr\Http\Server\RequestHandlerInterface;
use Symfony\Component\Console\Command\Command;

interface AppInterface
{
public function getContainer(): Container;

public function getRequestHandler(): RequestHandlerInterface;

/**
Expand Down
5 changes: 5 additions & 0 deletions framework/core/src/Install/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public function __construct(
) {
}

public function getContainer(): Container
{
return $this->container;
}

public function getRequestHandler(): RequestHandlerInterface
{
$pipe = new MiddlewarePipe;
Expand Down

0 comments on commit 608e2a7

Please sign in to comment.