| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait InteractsWithHttpHeaders |
||
| 8 | { |
||
| 9 | protected $headers = []; |
||
| 10 | |||
| 11 | public function getHeaders(): array |
||
| 14 | } |
||
| 15 | |||
| 16 | public function setHeaders(array $headers = []): self |
||
| 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 static::mergeBeforeKey($input, $key, $values); |
||
| 28 | } |
||
| 29 | |||
| 30 | protected static function mergeBeforeKey(array $input, int $key, array $values = []): array |
||
| 31 | { |
||
| 32 | return array_merge( |
||
| 33 | array_slice($input, 0, $key), |
||
| 34 | $values, |
||
| 35 | array_slice($input, $key) |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 39 | public static function compileHeaders(array $headers = []): array |
||
| 50 | } |
||
| 51 | } |
||
| 52 |