Skip to content

Commit

Permalink
Removed array constant (not allowed in PHP5.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshG4M committed Jun 29, 2018
1 parent 06f952c commit 8a419a3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/stats/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
class Stats
{
const DATE_FORMAT = 'Y-m-d';
const OPTIONS_SORT_DIRECTION = ['asc', 'desc'];
const OPTIONS_AGGREGATED_BY = ['day', 'week', 'month'];

private $optionsSortDirections = ['asc', 'desc'];
private $optionsAggregatedBy = ['day', 'week', 'month'];

// @var string
private $startDate;
Expand Down Expand Up @@ -50,7 +51,7 @@ public function __construct($startDate, $endDate = null, $aggregatedBy = null)
$this->validateOptions(
'aggregatedBy',
$aggregatedBy,
self::OPTIONS_AGGREGATED_BY
$this->optionsAggregatedBy
);
}
$this->startDate = $startDate;
Expand Down Expand Up @@ -134,7 +135,7 @@ public function getSum(
$this->validateOptions(
'sortByDirection',
$sortByDirection,
self::OPTIONS_SORT_DIRECTION
$this->optionsSortDirections
);
$this->validateInteger('limit', $limit);
$this->validateInteger('offset', $offset);
Expand Down Expand Up @@ -175,7 +176,7 @@ public function getSubuserMonthly(
$this->validateOptions(
'sortByDirection',
$sortByDirection,
self::OPTIONS_SORT_DIRECTION
$this->optionsSortDirections
);
$this->validateInteger('limit', $limit);
$this->validateInteger('offset', $offset);
Expand Down

0 comments on commit 8a419a3

Please sign in to comment.