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

StatusUpdated   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 28
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getOldStatus() 0 4 1
A getNewStatus() 0 4 1
A getModel() 0 4 1
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