MoveResult   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 3
c 1
b 0
f 0
dl 0
loc 22
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A notFound() 0 3 1
A __construct() 0 4 1
A found() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Inspirum\XML\Reader;
6
7
/**
8
 * @internal
9
 */
10
final class MoveResult
11
{
12
    /**
13
     * @param array<string,string> $namespaces
14
     */
15 37
    private function __construct(
16
        public readonly bool $found,
17
        public readonly array $namespaces,
18
    ) {
19 37
    }
20
21
    /**
22
     * @param array<string,string> $namespaces
23
     */
24 34
    public static function found(array $namespaces = []): self
25
    {
26 34
        return new self(true, $namespaces);
27
    }
28
29 29
    public static function notFound(): self
30
    {
31 29
        return new self(false, []);
32
    }
33
}
34