Conditions | 4 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
37 | 1 | public function queryUntilFoundOrTime(GetSatStatusCommand $command, int $waitSeconds = 120): GetSatStatusResult |
|
38 | { |
||
39 | 1 | $runUntilTime = time() + $waitSeconds; |
|
40 | do { |
||
41 | 1 | $result = $this->query($command); |
|
42 | 1 | if ('No Encontrado' === $result->cfdi() && time() <= $runUntilTime) { |
|
43 | 1 | usleep(200000); |
|
44 | 1 | continue; |
|
45 | } |
||
46 | 1 | break; |
|
47 | 1 | } while (true); |
|
48 | 1 | return $result; |
|
49 | } |
||
51 |