RepositoryEventBase   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getAction() 0 3 1
A getModel() 0 3 1
A getRepository() 0 3 1
1
<?php
2
namespace Salah3id\Domains\Repository\Events;
3
4
use Illuminate\Database\Eloquent\Model;
5
use Salah3id\Domains\Repository\Contracts\RepositoryInterface;
6
7
/**
8
 * Class RepositoryEventBase
9
 * @package Salah3id\Domains\Repository\Events
10
 * @author Anderson Andrade <[email protected]>
11
 */
12
abstract class RepositoryEventBase
13
{
14
    /**
15
     * @var Model
16
     */
17
    protected $model;
18
19
    /**
20
     * @var RepositoryInterface
21
     */
22
    protected $repository;
23
24
    /**
25
     * @var string
26
     */
27
    protected $action;
28
29
    /**
30
     * @param RepositoryInterface $repository
31
     * @param Model               $model
32
     */
33
    public function __construct(RepositoryInterface $repository, Model $model = null)
34
    {
35
        $this->repository = $repository;
36
        $this->model = $model;
37
    }
38
39
    /**
40
     * @return Model|array
41
     */
42
    public function getModel()
43
    {
44
        return $this->model;
45
    }
46
47
    /**
48
     * @return RepositoryInterface
49
     */
50
    public function getRepository()
51
    {
52
        return $this->repository;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getAction()
59
    {
60
        return $this->action;
61
    }
62
}
63