-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Six people, see below, spent more than two hours, to research this issue. They eventually gave up and decided to not raise an exception and instead return a Duration object that represents 0 seconds and 0 nanoseconds. Co-authored-by: Sebastian Bergmann <sb@sebastian-bergmann.de> Co-authored-by: Arne Blankerts <Arne@Blankerts.de> Co-authored-by: Andreas Möller <am@localheinz.com> Co-authored-by: Sebastian Heuer <sebastian@phpeople.de> Co-authored-by: Fabian Blechschmidt <blechschmidt@fabian-blechschmidt.de> Co-authored-by: Frank Sons <frank.sons@code-quality.de>
- Loading branch information
1 parent
15b2ae8
commit fac35fd
Showing
4 changed files
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,9 +56,6 @@ public function nanoseconds(): int | |
return $this->nanoseconds; | ||
} | ||
|
||
/** | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function duration(self $start): Duration | ||
{ | ||
$seconds = $this->seconds - $start->seconds(); | ||
|
@@ -71,7 +68,7 @@ public function duration(self $start): Duration | |
} | ||
|
||
if ($seconds < 0) { | ||
throw new InvalidArgumentException('Start needs to be smaller.'); | ||
return Duration::fromSecondsAndNanoseconds(0, 0); | ||
Check failure on line 71 in src/Event/Value/Telemetry/HRTime.php GitHub Actions / Type CheckerMissingThrowsDocblock
|
||
} | ||
|
||
return Duration::fromSecondsAndNanoseconds( | ||
Check failure on line 74 in src/Event/Value/Telemetry/HRTime.php GitHub Actions / Type CheckerMissingThrowsDocblock
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters