| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait InteractsWithHttpHeaders |
||
| 8 | { |
||
| 9 | protected $headers = []; |
||
| 10 | |||
| 11 | public function getHeaders(): array |
||
| 12 | { |
||
| 13 | return $this->headers; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function setHeaders(array $headers = []): self |
||
| 17 | { |
||
| 18 | $this->headers = $headers; |
||
| 19 | |||
| 20 | return $this; |
||
| 21 | } |
||
| 22 | |||
| 23 | protected static function mergeBeforePathInput(array $input, string $path, array $values = []): array |
||
| 24 | { |
||
| 25 | $key = array_search($path, $input) - 1; |
||
| 26 | |||
| 27 | return array_merge( |
||
| 28 | array_slice($input, 0, $key), |
||
| 29 | $values, |
||
| 30 | array_slice($input, $key) |
||
| 31 | ); |
||
| 32 | } |
||
| 33 | |||
| 34 | public static function compileHeaders(array $headers = []): array |
||
| 45 | } |
||
| 46 | } |
||
| 47 |