ClassNameCachedFoundEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 8
c 0
b 0
f 0
dl 0
loc 26
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A className() 0 3 1
A __construct() 0 4 1
A toString() 0 8 1
A cacheKey() 0 3 1
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