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

Loop   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invoke() 0 5 3
A __construct() 0 3 1
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