Loop   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 12
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
    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