Continuous Integration Fixes
This commit is contained in:
parent
911c0ff4b5
commit
70d16b7659
2 changed files with 8 additions and 10 deletions
|
@ -7,7 +7,6 @@ use Lubian\AttributeMagic\Infrastructure\Event\Dispatcher;
|
||||||
use Lubian\AttributeMagic\Infrastructure\Event\DispatcherFactory;
|
use Lubian\AttributeMagic\Infrastructure\Event\DispatcherFactory;
|
||||||
use Lubian\AttributeMagic\Infrastructure\Finder;
|
use Lubian\AttributeMagic\Infrastructure\Finder;
|
||||||
use Lubian\AttributeMagic\Infrastructure\HttpKernel;
|
use Lubian\AttributeMagic\Infrastructure\HttpKernel;
|
||||||
use Lubian\AttributeMagic\Infrastructure\WebApp\Request\RequestEvent;
|
|
||||||
use Lubian\AttributeMagic\Infrastructure\WebApp\Route\HandlerResolver;
|
use Lubian\AttributeMagic\Infrastructure\WebApp\Route\HandlerResolver;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
@ -26,9 +25,6 @@ $container = (new ContainerBuilder)->addDefinitions(
|
||||||
)->build();
|
)->build();
|
||||||
$kernel = $container->get(HttpKernel::class);
|
$kernel = $container->get(HttpKernel::class);
|
||||||
assert($kernel instanceof HttpKernel);
|
assert($kernel instanceof HttpKernel);
|
||||||
|
|
||||||
$response = $kernel->handle(Request::createFromGlobals());
|
$response = $kernel->handle(Request::createFromGlobals());
|
||||||
|
|
||||||
$response->send();
|
$response->send();
|
||||||
|
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<?php
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
namespace Lubian\AttributeMagic\Infrastructure;
|
namespace Lubian\AttributeMagic\Infrastructure;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use Lubian\AttributeMagic\Infrastructure\Event\Dispatcher;
|
use Lubian\AttributeMagic\Infrastructure\Event\Dispatcher;
|
||||||
use Lubian\AttributeMagic\Infrastructure\WebApp\Request\RequestEvent;
|
use Lubian\AttributeMagic\Infrastructure\WebApp\Request\RequestEvent;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
@ -10,13 +11,14 @@ use Symfony\Component\HttpFoundation\Response;
|
||||||
class HttpKernel
|
class HttpKernel
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Dispatcher $dispatcher,
|
private readonly Dispatcher $dispatcher
|
||||||
){}
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
public function handle(Request $request): Response
|
public function handle(Request $request): Response
|
||||||
{
|
{
|
||||||
$requestEvent = new RequestEvent($request);
|
$requestEvent = new RequestEvent($request);
|
||||||
$this->dispatcher->dispatch($requestEvent);
|
$this->dispatcher->dispatch($requestEvent);
|
||||||
|
return $requestEvent->response ?? throw new Exception('errror');
|
||||||
return $requestEvent->response ?? throw new \Exception('errror');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue