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

ClassNameNotFound::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
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