Completed
Push — master ( 1d77f8...1d8075 )
by Richan
01:31
created

CacheableEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 50
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A model() 0 4 1
A tags() 0 4 1
1
<?php
2
3
namespace Suitmedia\Cacheable\Events;
4
5
use Illuminate\Queue\SerializesModels;
6
use Suitmedia\Cacheable\Contracts\CacheableModel;
7
8
abstract class CacheableEvent
9
{
10
    use SerializesModels;
11
12
    /**
13
     * Cacheable model object.
14
     *
15
     * @var \Suitmedia\Cacheable\Contracts\CacheableModel
16
     */
17
    protected $model;
18
19
    /**
20
     * Cache tags which are being invalidating.
21
     *
22
     * @var mixed
23
     */
24
    protected $tags;
25
26
    /**
27
     * Event constructor.
28
     *
29
     * @param \Suitmedia\Cacheable\Contracts\CacheableModel $model
30
     * @param mixed                                         $tags
31
     */
32
    public function __construct(CacheableModel $model, $tags)
33
    {
34
        $this->model = $model;
35
        $this->tags = $tags;
36
    }
37
38
    /**
39
     * Model accessor.
40
     *
41
     * @return \Suitmedia\Cacheable\Contracts\CacheableModel
42
     */
43
    public function model()
44
    {
45
        return $this->model;
46
    }
47
48
    /**
49
     * Tags accessor.
50
     *
51
     * @return mixed
52
     */
53
    public function tags()
54
    {
55
        return $this->tags;
56
    }
57
}
58