1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 00:17:31 +02:00

fix(phpstan): code analysis

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
Sami Mazouz
2023-07-27 13:52:58 +01:00
parent 7467beb72f
commit 608e2a7e5a
3 changed files with 10 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ use Flarum\Foundation\ErrorHandling\Reporter;
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;
@@ -65,9 +65,7 @@ class Server
);
});
$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());

View File

@@ -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;
/**

View File

@@ -26,6 +26,11 @@ class Installer implements AppInterface
) {
}
public function getContainer(): Container
{
return $this->container;
}
public function getRequestHandler(): RequestHandlerInterface
{
$pipe = new MiddlewarePipe;