| @@ 122-132 (lines=11) @@ | ||
| 119 | * |
|
| 120 | * @return \DateTimeImmutable |
|
| 121 | */ |
|
| 122 | private function recomputeStartDateTime(): \DateTimeImmutable |
|
| 123 | { |
|
| 124 | $this->startDateTime = null; |
|
| 125 | foreach ($this->trackPoints() as $trackPoint) { |
|
| 126 | if ($this->startDateTime === null || $this->startDateTime > $trackPoint->dateTime()) { |
|
| 127 | $this->startDateTime = clone $trackPoint->dateTime(); |
|
| 128 | } |
|
| 129 | } |
|
| 130 | ||
| 131 | return $this->startDateTime; |
|
| 132 | } |
|
| 133 | ||
| 134 | /** |
|
| 135 | * Get the start date and time of the track. |
|
| @@ 153-163 (lines=11) @@ | ||
| 150 | * |
|
| 151 | * @return \DateTimeImmutable |
|
| 152 | */ |
|
| 153 | private function recomputeEndDateTime(): \DateTimeImmutable |
|
| 154 | { |
|
| 155 | $this->endDateTime = null; |
|
| 156 | foreach ($this->trackPoints() as $trackPoint) { |
|
| 157 | if ($this->startDateTime === null || $this->endDateTime < $trackPoint->dateTime()) { |
|
| 158 | $this->endDateTime = clone $trackPoint->dateTime(); |
|
| 159 | } |
|
| 160 | } |
|
| 161 | ||
| 162 | return $this->endDateTime; |
|
| 163 | } |
|
| 164 | ||
| 165 | /** |
|
| 166 | * Get the duration of the track. |
|