Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sibyx opened this issue Feb 17, 2021 · 0 comments

Comments

@Sibyx
Copy link
Owner

Sibyx commented Feb 17, 2021

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
@Sibyx Sibyx added this to the phpGPX 2.0 milestone Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant