AbstractEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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