| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class HttpLeagueFacade implements HttpFacadeInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var \Jellyfish\HttpLeague\HttpLeagueFactory |
||
| 14 | */ |
||
| 15 | protected $factory; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param \Jellyfish\HttpLeague\HttpLeagueFactory $factory |
||
| 19 | */ |
||
| 20 | public function __construct(HttpLeagueFactory $factory) |
||
| 21 | { |
||
| 22 | $this->factory = $factory; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
| 27 | * @return \Psr\Http\Message\ResponseInterface |
||
| 28 | */ |
||
| 29 | public function dispatch(ServerRequestInterface $request): ResponseInterface |
||
| 30 | { |
||
| 31 | return $this->factory->createRouter()->dispatch($request); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return \Psr\Http\Message\ServerRequestInterface |
||
| 36 | */ |
||
| 37 | public function getCurrentRequest(): ServerRequestInterface |
||
| 38 | { |
||
| 39 | return $this->factory->createRequest(); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param \Psr\Http\Message\ResponseInterface $response |
||
| 44 | * |
||
| 45 | * @return bool |
||
| 46 | */ |
||
| 47 | public function emit(ResponseInterface $response): bool |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param string $method |
||
| 54 | * @param string $path |
||
| 55 | * @param \Jellyfish\Http\ControllerInterface $controller |
||
| 56 | * |
||
| 57 | * @return \Jellyfish\Http\HttpFacadeInterface |
||
| 58 | */ |
||
| 59 | public function map(string $method, string $path, ControllerInterface $controller): HttpFacadeInterface |
||
| 66 |