Passed
Push — main ( 7a6063...0cf387 )
by Lorenzo
10:35
created

SuperCacheInvalidationEvent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
namespace Padosoft\SuperCacheInvalidate\Events;
4
5
use Illuminate\Foundation\Events\Dispatchable;
6
use Illuminate\Queue\SerializesModels;
7
8
class SuperCacheInvalidationEvent
9
{
10
    use Dispatchable;
11
    use SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Padosoft\SuperCacheInval...rCacheInvalidationEvent: $collectionClass, $id, $relations, $class, $connection, $keyBy
Loading history...
12
13
    /**
14
     * The cache identifier type ('key' or 'tag').
15
     *
16
     * @var string
17
     */
18
    public string $type;
19
20
    /**
21
     * The cache key or tag that was invalidated.
22
     *
23
     * @var string
24
     */
25
    public string $identifier;
26
27
    /**
28
     * The reason for invalidation.
29
     *
30
     * @var string|null
31
     */
32
    public ?string $reason;
33
34
    /**
35
     * Create a new event instance.
36
     *
37
     * @param string      $type       Identifier type ('key' or 'tag')
38
     * @param string      $identifier The cache key or tag
39
     * @param string|null $reason     Reason for invalidation
40
     */
41
    public function __construct(string $type, string $identifier, ?string $reason = null)
42
    {
43
        $this->type = $type;
44
        $this->identifier = $identifier;
45
        $this->reason = $reason;
46
    }
47
}
48