Skip to content

Commit 7035643

Browse files
committed
Update TracksActionStates to use ActionState enum
1 parent 86521a9 commit 7035643

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/Traits/TracksActionStates.php

+6-14
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,25 @@ trait TracksActionStates
1212
/**
1313
* Initialize the state for the given action.
1414
*
15-
* @param mixed $action
1615
* @return void
1716
*/
18-
public function initializeActionState($action)
17+
public function initializeActionState(Action $action)
1918
{
2019

21-
if ($action instanceof Action) {
22-
$action->setState(ActionState::PENDING);
23-
}
20+
$action->setState(ActionState::PENDING);
21+
2422
}
2523

2624
/**
2725
* Update the state of the given action.
2826
*
29-
* @param mixed $action
30-
* @param string $state
3127
* @param \Exception|null $exception
3228
* @return void
3329
*/
34-
public function updateActionState($action, $state, $exception = null)
30+
public function updateActionState(Action $action, ActionState $state, $exception = null)
3531
{
36-
37-
if ($action instanceof Action) {
38-
$action->setState($state);
39-
$action->setException($exception);
40-
}
32+
$action->setState($state);
33+
$action->setException($exception);
4134
}
4235

4336
public function passes(): bool
@@ -57,7 +50,6 @@ public function passes(): bool
5750
) {
5851
return false;
5952
}
60-
6153
}
6254

6355
return true;

0 commit comments

Comments
 (0)