private function createPoints(array $elevations) { $points = array(); foreach ($elevations as $index => $elevation) { $point = new Point(); $point->setTime(new \DateTime('+' . $index * 5 . ' seconds')); $point->setElevation($elevation); $points[] = $point; } return $points; }
private function createPoints(array $heartRates) { $points = array(); foreach ($heartRates as $index => $heartRate) { $point = new Point(); $point->setTime(new \DateTime('+' . $index * 5 . ' seconds')); $point->setHeartRate($heartRate); $points[] = $point; } return $points; }
private function createPoints(array $speeds) { $points = array(); foreach ($speeds as $index => $speed) { $point = new Point(); $point->setTime(new \DateTime('+' . $index * 5 . ' seconds')); $point->setSpeed($speed); $points[] = $point; } return $points; }
private function createPoints($numPoints) { $points = array(); for ($index = 0; $index < $numPoints; $index++) { $time = new \DateTime(); $time->setTimestamp($index * 5); $point = new Point(); $point->setTime($time); $points[] = $point; } return $points; }