Completed
Push — master ( 8717bc...dfb498 )
by Freek
8s
created

StatusUpdated::getModel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Spatie\ModelStatus\Events;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Event fired by the HasStatus trait when a status is updated
9
 *
10
 * @package Spatie\ModelStatus\Events
11
 */
12
class StatusUpdated
13
{
14
    protected $oldStatus;
15
    protected $newStatus;
16
    protected $model;
17
18
    public function __construct(string $oldStatus, string $newStatus, Model $model)
19
    {
20
        $this->oldStatus = $oldStatus;
21
        $this->newStatus = $newStatus;
22
        $this->model = $model;
23
    }
24
25
    public function getOldStatus(): string
26
    {
27
        return $this->oldStatus;
28
    }
29
30
    public function getNewStatus(): string
31
    {
32
        return $this->newStatus;
33
    }
34
35
    public function getModel(): Model
36
    {
37
        return $this->model;
38
    }
39
}
40