1 | <?php |
||
2 | |||
3 | namespace hamburgscleanest\GuzzleAdvancedThrottle; |
||
4 | |||
5 | use DateInterval; |
||
6 | |||
7 | trait TimeTravel |
||
8 | { |
||
9 | 41 | private function _tick(int $value, string $unit = 'S'): self |
|
10 | { |
||
11 | 41 | $this->_now = $this->_now->add(new DateInterval('PT' . $value . $unit)); |
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
12 | |||
13 | 41 | return $this; |
|
14 | } |
||
15 | |||
16 | 37 | public function advanceSeconds(int $seconds): self |
|
17 | { |
||
18 | 37 | return $this->_tick($seconds, 'S'); |
|
19 | } |
||
20 | |||
21 | 10 | public function advanceMinutes(int $minutes): self |
|
22 | { |
||
23 | 10 | return $this->_tick($minutes, 'M'); |
|
24 | } |
||
25 | } |
||
26 |