Completed
Push — master ( fc6b0c...d75285 )
by Shinji
12s queued 10s
created

Loop::invoke()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 3
nc 3
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the sj-i/php-profiler package.
5
 *
6
 * (c) sji <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace PhpProfiler\Lib\Loop;
15
16
final class Loop
17
{
18
    private LoopProcessInterface $process;
19
20
    public function __construct(LoopProcessInterface $process)
21
    {
22
        $this->process = $process;
23
    }
24
25
    public function invoke(): void
26
    {
27
        while (1) {
28
            if (!$this->process->invoke()) {
29
                return;
30
            }
31
        }
32
    }
33
}
34