Skip to content

startedAt and finishedAt values are not present if the first (or last) point is without timestamp #51

@Sibyx

Description

@Sibyx

Problem description

Current behaviour of the library (as of 1.1.1) fills the Stats object wih timestamp value of the first and last point object. If there is no such datetime, these value are not inside the Stats object.

Problematic code:

$firstPoint = &$this->points[0];
$lastPoint = end($this->points);

$this->stats->startedAt = $firstPoint->time; // problematic if null
$this->stats->finishedAt = $lastPoint->time;  // problematic if null

Expected behaviour

  • startedAt suppose to have the first not-null $point->time value
  • finishedAt suppose to have the last not-null $point->time value

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions