From 580a178fe276a359ed5deddafd74a05c30f9acd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20GOULPEAU=E2=80=8B=E2=80=8B?= Date: Thu, 1 Dec 2016 16:04:43 +0100 Subject: [PATCH] change namespace --- CookedMeasure/Coordinate.php | 2 +- DependencyInjection/Configuration.php | 2 +- .../QowisioCloudApiExtension.php | 2 +- Exception/QowisioCredentialsException.php | 2 +- Exception/QowisioException.php | 2 +- QowisioCloudApiBundle.php | 2 +- Resources/config/services.yml | 10 ++++---- Service/QowisioApiAuthenticationService.php | 6 ++--- Service/QowisioApiCaller.php | 6 ++--- .../QowisioApiDevicesAndSensorsService.php | 4 ++-- Service/QowisioApiMeasuresService.php | 10 ++++---- Service/QowisioTrackerService.php | 23 +++++++++++-------- 12 files changed, 37 insertions(+), 34 deletions(-) diff --git a/CookedMeasure/Coordinate.php b/CookedMeasure/Coordinate.php index 957ba09..015e3be 100644 --- a/CookedMeasure/Coordinate.php +++ b/CookedMeasure/Coordinate.php @@ -1,6 +1,6 @@ * You can add 'from_date' and 'to_date' filters to request data on a specific range and 'limit', to limit the number of results.
- * @param string $sensorUid - * @param \DateTime $from Date when search starts - * @param \DateTime $to Date when search stop + * @param string $sensorUid + * @param \DateTime $from Date when search starts + * @param \DateTime $to Date when search stop * @param integer $limit * @return array */ diff --git a/Service/QowisioTrackerService.php b/Service/QowisioTrackerService.php index 4d9c41d..a3cd4b4 100644 --- a/Service/QowisioTrackerService.php +++ b/Service/QowisioTrackerService.php @@ -1,8 +1,8 @@ */ public function getLastCoordinates($deviceUid, $sort = self::SORT_DESC) { @@ -46,11 +47,12 @@ public function getLastCoordinates($deviceUid, $sort = self::SORT_DESC) /** * Get the GPS coordinates from the device - * @param string $deviceUid the UID of the device - * @param \DateTime $from Date when search starts - * @param \DateTime $to Date when search stop - * @param integer $limit optionnal default 100 - * @param string $sort optionnal default QowisioTrackerService::SORT_DESC. one of QowisioTrackerService::SORT_DESC or QowisioTrackerService::SORT_ASC + * @param string $deviceUid The UID of the device + * @param \DateTime $from Date when search starts + * @param \DateTime $to Date when search stop + * @param integer $limit optionnal default 100 + * @param string $sort optionnal default QowisioTrackerService::SORT_DESC. one of QowisioTrackerService::SORT_DESC or QowisioTrackerService::SORT_ASC + * @return array */ public function getCoordinates($deviceUid, \DateTime $from, \DateTime $to, $limit = 100, $sort = self::SORT_DESC) { @@ -80,10 +82,11 @@ protected function getGpsCoordinates($latitudeList, $longitudeList, $sort) } if ($sort === static::SORT_ASC) { - $ascending = function($coordA, $coordB) { + $ascending = function ($coordA, $coordB) { if ($coordA->getTimestampCollected() === $coordB->getTimestampCollected()) { return 0; } + return $coordA->getTimestampCollected() < $coordB->getTimestampCollected() ? -1 : 1; }; usort($coordinates, $ascending);