| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class TakeLessThanMatcher extends AbstractTakeThanMatcher |
||
| 10 | { |
||
| 11 | protected $keywords = [ |
||
| 12 | 'takeLessThan', |
||
| 13 | 'lastLessThan', |
||
| 14 | ]; |
||
| 15 | |||
| 16 | 2 | public function verifyNegative(callable $callable, array $arguments, float $timeInSeconds): bool |
|
| 17 | { |
||
| 18 | 2 | $elapsedTime = $this->bench($callable, $arguments); |
|
| 19 | |||
| 20 | 2 | if (false === $timeInSeconds > $elapsedTime) { |
|
| 21 | 1 | return true; |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | throw TimeMatcherException::tooFastMatcherException( |
|
| 25 | 1 | $this->presenter, |
|
| 26 | $elapsedTime, |
||
| 27 | $timeInSeconds |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | 2 | public function verifyPositive(callable $callable, array $arguments, float $timeInSeconds): bool |
|
| 43 | ); |
||
| 44 | } |
||
| 46 |