Passed
Pull Request — master (#22)
by Luis
24:40 queued 21:48
created

RelationshipsResolvers   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 20
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0
wmc 4
1
<?php declare(strict_types=1);
2
/**
3
 * PHP version 8.1
4
 *
5
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
6
 */
7
8
namespace PhUml\Parser\Code;
9
10
use PhUml\Code\Codebase;
11
12
final class RelationshipsResolvers
13
{
14 9
    public static function withAssociations(): RelationshipsResolvers
15
    {
16 9
        return new RelationshipsResolvers([new ExternalDefinitionsResolver(), new ExternalAssociationsResolver()]);
17
    }
18
19 22
    public static function withoutAssociations(): RelationshipsResolvers
20
    {
21 22
        return new RelationshipsResolvers([new ExternalDefinitionsResolver()]);
22
    }
23
24 25
    public function addExternalDefinitionsTo(Codebase $codebase): void
25
    {
26 25
        array_map(static fn (RelationshipsResolver $resolver) => $resolver->resolve($codebase), $this->resolvers);
27
    }
28
29
    /** @param RelationshipsResolver[] $resolvers */
30 31
    private function __construct(private readonly array $resolvers)
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_ARRAY, expecting T_VARIABLE on line 30 at column 50
Loading history...
31
    {
32
    }
33
}
34