ClassNameCachedFoundEvent::toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 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
use Override;
9
10
use function sprintf;
11
12
final class ClassNameCachedFoundEvent implements GacelaEventInterface
13
{
14
    public function __construct(
15
        private readonly string $cacheKey,
16
        private readonly string $className,
17
    ) {
18
    }
19
20
    public function cacheKey(): string
21
    {
22
        return $this->cacheKey;
23
    }
24
25
    public function className(): string
26
    {
27
        return $this->className;
28
    }
29
30
    #[Override]
31
    public function toString(): string
32
    {
33
        return sprintf(
34
            '%s {cacheKey:"%s", className:"%s"}',
35
            self::class,
36
            $this->cacheKey,
37
            $this->className,
38
        );
39
    }
40
}
41