Conditions | 3 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 6 | public function parse(\stdClass $object, int $index): Detour |
|
20 | { |
||
21 | 6 | return new Detour( |
|
22 | 6 | $object->id, |
|
23 | 6 | str_contains($object->properties->type, '_EXTERNAL'), |
|
24 | 6 | $this->geometryParser->parse($object->geometry), |
|
25 | 6 | ($object->properties->name ?? '') ?: sprintf('Omleiding %d', $index + 1), |
|
26 | 6 | Direction::from($object->properties->direction), |
|
27 | 6 | !empty($object->properties->transportMode) ? TransportMode::from($object->properties->transportMode) : null, |
|
28 | 6 | array_map([VehicleType::class, 'from'], $object->properties->vehicleTypes), |
|
29 | 6 | array_map([BoatType::class, 'from'], $object->properties->boatTypes) |
|
30 | 3 | ); |
|
33 |