Loop::invoke()   A
last analyzed

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
    public function __construct(
19
        private LoopMiddlewareInterface $process,
20
    ) {
21
    }
22
23
    public function invoke(): void
24
    {
25
        while (1) {
26
            if (!$this->process->invoke()) {
27
                break;
28
            }
29
        }
30
    }
31
}
32