ClassNameCachedFoundEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\Event\ClassResolver\ClassNameFinder;
6
7
use Gacela\Framework\Event\GacelaEventInterface;
8
9
use function sprintf;
10
11
final class ClassNameCachedFoundEvent implements GacelaEventInterface
12
{
13
    public function __construct(
14
        private readonly string $cacheKey,
15
        private readonly string $className,
16
    ) {
17
    }
18
19
    public function cacheKey(): string
20
    {
21
        return $this->cacheKey;
22
    }
23
24
    public function className(): string
25
    {
26
        return $this->className;
27
    }
28
29
    public function toString(): string
30
    {
31
        return sprintf(
32
            '%s {cacheKey:"%s", className:"%s"}',
33
            self::class,
34
            $this->cacheKey,
35
            $this->className,
36
        );
37
    }
38
}
39