Skip to content

Commit

Permalink
Update config. (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Jun 28, 2023
1 parent 25cf11f commit f650140
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
10 changes: 10 additions & 0 deletions config/web/psr-http-message.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

use HttpSoft\ServerRequest\ServerRequestCreator;
use Psr\Http\Message\ServerRequestInterface;

return [
ServerRequestInterface::class => ServerRequestCreator::create(),
];
10 changes: 3 additions & 7 deletions src/Framework/Runner/HttpApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Yii\Framework\Runner;

use ErrorException;
use HttpSoft\ServerRequest\ServerRequestCreator;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -107,12 +106,9 @@ public function run(): void

/** @var Application $application */
$application = $container->get(Application::class);

/**
* @var ServerRequestInterface $serverRequestFactory
*/
$serverRequestFactory = ServerRequestCreator::create();
$serverRequest = $serverRequestFactory->withAttribute('applicationStartTime', $startTime);
/** @var ServerRequestInterface $serverRequest */
$serverRequest = $container->get(ServerRequestInterface::class);
$serverRequest = $serverRequest->withAttribute('applicationStartTime', $startTime);

try {
$application->start();
Expand Down

0 comments on commit f650140

Please sign in to comment.