Completed
Pull Request — master (#32)
by Brent
01:07
created

StateChanged   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 32
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\ModelStates\Events;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Queue\SerializesModels;
7
use Spatie\ModelStates\State;
8
use Spatie\ModelStates\Transition;
9
10
class StateChanged
11
{
12
    use SerializesModels;
13
14
    public ?State $initialState = null;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected '?', expecting T_FUNCTION or T_CONST
Loading history...
15
16
    public ?State $finalState = null;
17
18
    public Transition $transition;
19
20
    public Model $model;
21
22
    public function __construct(
23
        ?State $initialState,
24
        ?State $finalState,
25
        Transition $transition,
26
        Model $model
27
    ) {
28
        $this->initialState = $initialState;
29
        $this->finalState = $finalState;
30
        $this->transition = $transition;
31
        $this->model = $model;
32
    }
33
}
34