| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.3332 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | 2 | public static function createFromRequest(Request $request, array $destination) |
|
| 11 | { |
||
| 12 | 2 | if (array_keys($destination) === range(0, count($destination) - 1)) { |
|
| 13 | $destination = array_combine($destination, $destination); |
||
| 14 | } |
||
| 15 | |||
| 16 | 2 | $attrs = []; |
|
| 17 | 2 | foreach ($destination as $seo => $attribute) { |
|
| 18 | $attrs[$seo] = $request->attributes->get($attribute); |
||
| 19 | 2 | } |
|
| 20 | |||
| 21 | 2 | return new Destination($request->attributes->get('_route'), $attrs); |
|
| 22 | } |
||
| 23 | } |
||
| 24 |