Skip to content

Commit 66e1f56

Browse files
committed
fix trait
1 parent 7640e07 commit 66e1f56

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/adverbs/src/Traits/HasVerbsState.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ trait HasVerbsState
1212
/**
1313
* Get the state class for this model.
1414
*/
15-
protected function getVerbsState(): string
15+
protected function getStateClass(): string
1616
{
17+
throw_if(
18+
condition: empty($this->state_class),
19+
exception: 'State class is not set',
20+
);
21+
1722
$state = $this->state_class;
18-
throw_if(! class_exists($state), 'Unknown class '.$this->verbs_state);
23+
24+
throw_if(
25+
condition: ! class_exists($state),
26+
exception: 'Unknown class '.$state,
27+
);
1928

2029
return $state;
2130
}

0 commit comments

Comments
 (0)