| Total Complexity | 5 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Step |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var array |
||
| 12 | */ |
||
| 13 | private $position; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var Distance |
||
| 17 | */ |
||
| 18 | private $distance; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var Duration |
||
| 22 | */ |
||
| 23 | private $duration; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $instruction; |
||
| 29 | |||
| 30 | public function __construct(array $data) |
||
| 31 | { |
||
| 32 | $this->position = $data['position'] ?? []; |
||
| 33 | $this->instruction = $data['instruction'] ?? ''; |
||
| 34 | $this->duration = new Duration((int) ($data['instruction'] ?? 0)); |
||
| 35 | $this->distance = new Distance((int) ($data['distance'] ?? 0)); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get the value of position. |
||
| 40 | * |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | public function getPosition(): array |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get the value of distance. |
||
| 50 | * |
||
| 51 | * @return Distance |
||
| 52 | */ |
||
| 53 | public function getDistance(): Distance |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Get the value of duration. |
||
| 60 | * |
||
| 61 | * @return Duration |
||
| 62 | */ |
||
| 63 | public function getDuration(): Duration |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Get the value of instruction. |
||
| 70 | * |
||
| 71 | * @return string |
||
| 72 | */ |
||
| 73 | public function getInstruction(): string |
||
| 76 | } |
||
| 77 | } |
||
| 78 |