Skip to content

Commit

Permalink
Merge pull request #561 from stripe/brandur-minor-fixes
Browse files Browse the repository at this point in the history
Add some minor code niceties following up #549
  • Loading branch information
brandur-stripe authored Nov 20, 2018
2 parents 2a87430 + 7b7baae commit 1220a7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/RequestTelemetry.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class RequestTelemetry
public $requestId;
public $requestDuration;

/**
* Initialize a new telemetry object.
*
* @param string $requestId The request's request ID.
* @param int $requestDuration The request's duration in milliseconds.
*/
public function __construct($requestId, $requestDuration)
{
$this->requestId = $requestId;
Expand Down
4 changes: 2 additions & 2 deletions lib/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ public static function normalizeId($id)
/**
* Returns UNIX timestamp in milliseconds
*
* @return float current time in millis
* @return integer current time in millis
*/
public static function currentTimeMillis()
{
return round(microtime(true) * 1000);
return (int) round(microtime(true) * 1000);
}
}

0 comments on commit 1220a7e

Please sign in to comment.