Skip to content

Commit

Permalink
Added StreamFactory to HttpServiceProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
reinvanoyen authored May 4, 2020
1 parent 6c377e6 commit 79cfba8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Http/HttpServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Oak\Http\Routing\Router;
use Oak\ServiceProvider;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\ServerRequestInterface;

class HttpServiceProvider extends ServiceProvider
Expand All @@ -26,7 +27,7 @@ public function register(ContainerInterface $app)
$app->singleton(KernelInterface::class, Kernel::class);
$app->set(ResponseEmitterInterface::class, ResponseEmitter::class);
$app->set(ResponseFactoryInterface::class, Psr17Factory::class);

$app->set(StreamFactoryInterface::class, Psr17Factory::class);
$app->set(ServerRequestInterface::class, function($app) {
$psr17Factory = $app->get(ResponseFactoryInterface::class);
return (new ServerRequestCreator(
Expand All @@ -37,4 +38,4 @@ public function register(ContainerInterface $app)
))->fromGlobals();
});
}
}
}

0 comments on commit 79cfba8

Please sign in to comment.