| 1 | <?php |
||
| 4 | class Factory |
||
| 5 | { |
||
| 6 | use \FMUP\Sapi\OptionalTrait; |
||
| 7 | |||
| 8 | const CONTENT_TYPE = 'Content-Type'; |
||
| 9 | const JSON_HEADER = 'application/json'; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Build the correct request object |
||
| 13 | * @return Cli|Http|Json |
||
| 14 | */ |
||
| 15 | 7 | public function get() |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Checks if request should be cli |
||
| 28 | * @return bool |
||
| 29 | */ |
||
| 30 | 7 | private function isCli() |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Checks if request should be json |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | 5 | private function isJson() |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Retrieve headers of the request |
||
| 47 | * @codeCoverageIgnore |
||
| 48 | * @return array|false |
||
| 49 | */ |
||
| 50 | protected function getHeaders() |
||
| 54 | } |
||
| 55 |