AbstractEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 38
ccs 4
cts 8
cp 0.5
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getModel() 0 3 1
A getRepository() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Noitran\Repositories\Events;
6
7
use Illuminate\Database\Eloquent\Model;
8
use Noitran\Repositories\Contracts\Repository\RepositoryInterface;
9
10
abstract class AbstractEvent
11
{
12
    /**
13
     * @var RepositoryInterface
14
     */
15
    protected $repository;
16
17
    /**
18
     * @var Model
19
     */
20
    protected $model;
21
22
    /**
23
     * AbstractEvent constructor.
24
     *
25
     * @param RepositoryInterface $repository
26 5
     * @param Model $model
27
     */
28 5
    public function __construct(RepositoryInterface $repository, Model $model)
29 5
    {
30 5
        $this->repository = $repository;
31
        $this->model = $model;
32
    }
33
34
    /**
35
     * @return RepositoryInterface
36
     */
37
    public function getRepository(): RepositoryInterface
38
    {
39
        return $this->repository;
40
    }
41
42
    /**
43
     * @return Model
44
     */
45
    public function getModel(): Model
46
    {
47
        return $this->model;
48
    }
49
}
50