| Total Complexity | 13 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 15% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | trait HasInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Get the input source for the request. |
||
| 13 | * |
||
| 14 | * @return \Symfony\Component\HttpFoundation\ParameterBag |
||
| 15 | */ |
||
| 16 | 1 | protected function getInputSource() |
|
| 17 | { |
||
| 18 | 1 | if ($this->isJson()) { |
|
|
|
|||
| 19 | return $this->json(); |
||
| 20 | } |
||
| 21 | |||
| 22 | 1 | return in_array($this->getRealMethod(), ['GET', 'HEAD']) ? $this->query : $this->request; |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return bool |
||
| 27 | */ |
||
| 28 | public function isCLI() |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Determine if the request is the result of an AJAX call. |
||
| 55 | * |
||
| 56 | * @return bool |
||
| 57 | */ |
||
| 58 | public function ajax() |
||
| 59 | { |
||
| 60 | return $this->isXmlHttpRequest(); |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Determine if the request is the result of an PJAX call. |
||
| 65 | * |
||
| 66 | * @return bool |
||
| 67 | */ |
||
| 68 | public function pjax() |
||
| 71 | } |
||
| 72 | } |
||
| 73 |