| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function __invoke(Request $request, Response $response, $next) |
||
| 27 | { |
||
| 28 | if ($next && is_callable($next)) { |
||
| 29 | $response = $next($request, $response); |
||
| 30 | } |
||
| 31 | |||
| 32 | $methods = $this->methods($request); |
||
| 33 | |||
| 34 | return $response |
||
| 35 | ->withHeader('Access-Control-Allow-Origin', '*') |
||
| 36 | ->withHeader('Access-Control-Allow-Headers', implode(',', self::HEADERS)) |
||
| 37 | ->withHeader('Access-Control-Allow-Methods', implode(',', $methods)); |
||
| 38 | } |
||
| 60 |