Skip to content

Commit ee1f8af

Browse files
authored
Merge pull request #5 from maplephp/develop
Interface wiring
2 parents aba62ab + 56fde34 commit ee1f8af

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/AbstractKernel.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use MaplePHP\Http\Interfaces\PathInterface;
2525
use MaplePHP\Http\Stream;
2626
use Psr\Container\ContainerInterface;
27+
use Psr\Http\Message\RequestInterface;
2728
use Psr\Http\Message\ResponseInterface;
2829
use Psr\Http\Message\ServerRequestInterface;
2930
use Psr\Http\Message\StreamInterface;
@@ -136,11 +137,11 @@ protected function initRequestHandler(
136137
{
137138

138139
$this->bindInterfaces([
139-
"ContainerInterface" => $this->container,
140-
"RequestInterface" => $request,
141-
"ServerRequestInterface" => $request,
142-
"StreamInterface" => $stream,
143-
"PathInterface" => fn() => $path
140+
ContainerInterface::class => $this->container,
141+
RequestInterface::class => $request,
142+
ServerRequestInterface::class => $request,
143+
StreamInterface::class => $stream,
144+
PathInterface::class => $path
144145
]);
145146

146147
$middlewares = array_merge($this->userMiddlewares, $middlewares);

src/ControllerRequestHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
2828
$response = $this->factory->createResponse();
2929

3030
$this->appendInterfaces([
31-
"ResponseInterface" => $response,
31+
ResponseInterface::class => $response,
3232
]);
3333

3434
$controller = $this->controller;

0 commit comments

Comments
 (0)