UnresolvableDomainIdsCollectionException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 27
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExceptions() 0 3 1
A withExceptions() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gember\EventSourcing\Resolver\DomainEvent\DomainIds;
6
7
final class UnresolvableDomainIdsCollectionException extends UnresolvableDomainIdsException
8
{
9
    /**
10
     * @var list<UnresolvableDomainIdsException>
0 ignored issues
show
Bug introduced by
The type Gember\EventSourcing\Res...ainEvent\DomainIds\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
     */
12
    private array $exceptions = [];
13
14
    /**
15
     * @param class-string $eventClassName
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string.
Loading history...
16
     */
17 2
    public static function withExceptions(
18
        string $eventClassName,
19
        string $message,
20
        UnresolvableDomainIdsException ...$exceptions,
21
    ): self {
22 2
        $exception = new self(sprintf('Unresolvable domainIds for event %s: %s', $eventClassName, $message));
23 2
        $exception->exceptions = array_values($exceptions);
0 ignored issues
show
Documentation Bug introduced by
It seems like array_values($exceptions) of type array is incompatible with the declared type Gember\EventSourcing\Res...ainEvent\DomainIds\list of property $exceptions.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
24
25 2
        return $exception;
26
    }
27
28
    /**
29
     * @return list<UnresolvableDomainIdsException>
30
     */
31 1
    public function getExceptions(): array
32
    {
33 1
        return $this->exceptions;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->exceptions returns the type array which is incompatible with the documented return type Gember\EventSourcing\Res...ainEvent\DomainIds\list.
Loading history...
34
    }
35
}
36