| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 9 | public function handle(Request $request, Closure $next) : Response |
|
| 25 | { |
||
| 26 | |||
| 27 | 9 | if (!$this->requestHasParsableFlexibleInputs($request)) { |
|
| 28 | 4 | return $next($request); |
|
| 29 | } |
||
| 30 | |||
| 31 | 5 | $request->merge($this->getParsedFlexibleInputs($request)); |
|
| 32 | 5 | $request->request->remove(FlexibleAttribute::REGISTER_FLEXIBLE_FIELD_NAME); |
|
| 33 | |||
| 34 | 5 | $response = $next($request); |
|
| 35 | |||
| 36 | 5 | if (!$this->shouldTransformFlexibleErrors($response)) { |
|
| 37 | 4 | return $response; |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | return $this->transformFlexibleErrors($response); |
|
| 41 | } |
||
| 43 |