Skip to content

Commit

Permalink
Merge pull request #44 from hughgrigg/analysis-8K9x52
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
hughgrigg committed Nov 17, 2018
2 parents 80ae979 + 694b4ee commit a671786
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hughgrigg/php-business-time",
"description": "Business time / working days extension for Carbon dates",
"version": "1.1.1",
"version": "1.1.2",
"type": "library",
"require": {
"php": "^7.0",
Expand Down
6 changes: 2 additions & 4 deletions src/Interval.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,11 @@ public static function intervalToSeconds(
DateInterval $dateInterval,
$trimMicroseconds = true
): int {
$microseconds =
$dateInterval->f =
$trimMicroseconds ||
version_compare(PHP_VERSION, '7.1.0-dev', '<') ? 0 :
$dateInterval->f;
if ($microseconds) {
$dateInterval->f = $microseconds;
}

return (new Carbon())->add($dateInterval)->diffInRealSeconds(
new Carbon()
);
Expand Down

0 comments on commit a671786

Please sign in to comment.