Passed
Push — feature/add-class-name-finder-... ( 772f7c )
by Chema
04:38
created

ClassNameNotFound   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 42.86%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 23
ccs 3
cts 7
cp 0.4286
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toString() 0 7 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\Event\ClassResolver\ClassNameFinder;
6
7
use Gacela\Framework\ClassResolver\ClassInfo;
8
use Gacela\Framework\Event\GacelaEventInterface;
9
10
final class ClassNameNotFound implements GacelaEventInterface
11
{
12
    private ClassInfo $classInfo;
13
14
    /** @var list<string> */
15
    private array $resolvableTypes;
16
17
    /**
18
     * @param list<string> $resolvableTypes
19
     */
20 10
    public function __construct(ClassInfo $classInfo, array $resolvableTypes)
21
    {
22 10
        $this->classInfo = $classInfo;
23 10
        $this->resolvableTypes = $resolvableTypes;
0 ignored issues
show
Documentation Bug introduced by
It seems like $resolvableTypes of type array is incompatible with the declared type Gacela\Framework\Event\C...er\ClassNameFinder\list of property $resolvableTypes.

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
26
    public function toString(): string
27
    {
28
        return sprintf(
29
            '%s - %s - %s',
30
            self::class,
31
            $this->classInfo->toString(),
32
            implode(',', $this->resolvableTypes)
33
        );
34
    }
35
}
36