Created
October 19, 2014 21:24
-
-
Save anonymous/f276054e9866456021bc to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ <?php namespace Acme; use Symfony\Component\HttpKernel\HTTPKernelInterface; use Psr\Http\Message\Request; class MyMiddleware implements HTTPKernelInterface { private $kernel; public function __construct(HTTPKernelInterface $kernel) { $this->kernel = $kernel; } public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) { return $this->kernel->handle( new MyRequestDecorator($request), $type, $catch ) } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php namespace Acme; use Psr\Http\Message\Request; class MyRequestDecorator implements Request { private $request; public function __construct(Request $request) { $this->request = $request; } public function getQueryParams() { return ['foo' => 'bar']; } // Act as a proxy for all other methods... }