Skip to content

Commit

Permalink
replace DiactorosFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Mar 11, 2020
1 parent ad02c4c commit fcf4951
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
"monolog/monolog": "^1.12|^2.0",
"riverline/multipart-parser": "^2.0",
"symfony/process": "^4.3|^5.0",
"symfony/psr-http-message-bridge": "^1.2",
"zendframework/zend-diactoros": "^2.1"
"laminas/laminas-diactoros": "^2.2",
"nyholm/psr7": "^1.0",
"symfony/psr-http-message-bridge": "^2.0"
},
"require-dev": {
"mockery/mockery": "^1.2",
Expand Down
15 changes: 12 additions & 3 deletions src/Runtime/Handlers/AppHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
use Laravel\Vapor\Runtime\Http\PsrRequestFactory;
use Laravel\Vapor\Runtime\PsrLambdaResponseFactory;
use Illuminate\Console\Application as ConsoleApplication;
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Laminas\Diactoros\ResponseFactory;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\StreamFactory;
use Laminas\Diactoros\UploadedFileFactory;

class AppHandler implements LambdaEventHandler
{
Expand All @@ -33,7 +37,12 @@ public function handle(array $event)
));

return $this->marshalResponse(
(new DiactorosFactory)->createResponse($response)
(new PsrHttpFactory(
new ServerRequestFactory,
new StreamFactory,
new UploadedFileFactory,
new ResponseFactory
))->createResponse($response)
);
} finally {
if (isset($app)) {
Expand All @@ -57,7 +66,7 @@ protected function marshalRequest(array $event)
/**
* Marshal the PSR-7 response to a Lambda response.
*
* @param Psr\Http\Message\ResponseInterface $response
* @param \Psr\Http\Message\ResponseInterface $response
* @return \Laravel\Vapor\Runtime\ArrayLambdaResponse
*/
protected function marshalResponse(ResponseInterface $response)
Expand Down
2 changes: 1 addition & 1 deletion src/Runtime/Handlers/LoadBalancedAppHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function marshalRequest(array $event)
/**
* Marshal the PSR-7 response to a Lambda response.
*
* @param Psr\Http\Message\ResponseInterface $response
* @param \Psr\Http\Message\ResponseInterface $response
* @return \Laravel\Vapor\Runtime\ArrayLambdaResponse
*/
protected function marshalResponse(ResponseInterface $response)
Expand Down

0 comments on commit fcf4951

Please sign in to comment.