Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class Entity
*
* @param $tag
* @param $data
* @param int $time unixtime
* @param int|float $time unixtime with microseconds
*/
public function __construct($tag, $data, $time = null)
{
if (is_long($time)) {
if (is_long($time) || is_float($time)) {
$this->time = $time;
} else {
if (!is_null($time)) {
error_log("Entity::__construct(): unexpected time format `{$time}` specified.");
}

$this->time = time();
$this->time = microtime(true);
}

$this->tag = $tag;
Expand Down Expand Up @@ -81,4 +81,4 @@ public function getTime()
{
return $this->time;
}
}
}