Skip to content

Commit

Permalink
Change TimeBucketImplementationInterface to TimeOrderedStorageInterface
Browse files Browse the repository at this point in the history
Add in initial support for timezoned buckets [WIP]
  • Loading branch information
lucasnetau committed Apr 27, 2021
1 parent 7c99710 commit 6900437
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/TimeBucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
class TimeBucket implements Countable, IteratorAggregate, Serializable, JsonSerializable {

/**
* @var TimeBucketImplementationInterface
* @var TimeOrderedStorageInterface
*/
protected TimeBucketImplementationInterface $innerQueue;
protected TimeOrderedStorageInterface $innerQueue;

/**
* Pre-defined formats to segment DateTime
Expand All @@ -50,8 +50,11 @@ class TimeBucket implements Countable, IteratorAggregate, Serializable, JsonSeri
"date" => "Y-m-d",
"day" => "Y-m-d",
"hour" => "Y-m-d H:00:00",
"hourtz" => "Y-m-d\TH:00:00P",
"minute" => "Y-m-d H:i:00",
"minutetz" => "Y-m-d\TH:i:00P",
"second" => "Y-m-d H:i:s",
"secondtz" => "Y-m-d\TH:i:sP",
"dayofmonth" => "d",
"dayofweek" => "w",
"hourofday" => "H",
Expand Down Expand Up @@ -147,9 +150,9 @@ public function insert($datum, $priority)
}

/**
* @return TimeBucketImplementationInterface
* @return TimeOrderedStorageInterface
*/
public function getIterator() : TimeBucketImplementationInterface
public function getIterator() : TimeOrderedStorageInterface
{
return clone $this->innerQueue;
}
Expand Down

0 comments on commit 6900437

Please sign in to comment.