Skip to content

Commit

Permalink
Merge pull request #2564 from briannesbitt/fix/lint
Browse files Browse the repository at this point in the history
Add explicit cast for U and u formats operations
  • Loading branch information
kylekatarnls authored Mar 10, 2022
2 parents bc073d7 + e5948f0 commit 5c51090
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Carbon/Traits/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ public function get($name)
case $name === 'millisecond':
// @property int
case $name === 'milli':
return (int) floor($this->rawFormat('u') / 1000);
return (int) floor(((int) $this->rawFormat('u')) / 1000);

// @property int 1 through 53
case $name === 'week':
Expand Down
2 changes: 1 addition & 1 deletion src/Carbon/Traits/Timestamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function timestamp($unixTimestamp)
*/
public function getPreciseTimestamp($precision = 6)
{
return round($this->rawFormat('Uu') / pow(10, 6 - $precision));
return round(((float) $this->rawFormat('Uu')) / pow(10, 6 - $precision));
}

/**
Expand Down

0 comments on commit 5c51090

Please sign in to comment.