-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCatDefinition.php
45 lines (40 loc) · 1010 Bytes
/
CatDefinition.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Hyn\Statemachine\Stubs\Definitions;
use Hyn\Statemachine\Contracts\MachineDefinitionContract;
use Hyn\Statemachine\Stubs\Models\Cat;
use Hyn\Statemachine\Stubs\States\Cat\Asleep;
use Hyn\Statemachine\Stubs\States\Cat\Awake;
use Hyn\Statemachine\Stubs\Transitions\Cat\WakesUp;
class CatDefinition implements MachineDefinitionContract
{
/**
* Models assigned to this statemachine definition.
*
* @return array
*/
public function models() : array
{
return [
Cat::class
];
}
/**
* The flow from states to transitions the state machine has to respect.
*
* @see https://state-machine.readme.io/v1.0/docs/the-definition
*
* @return array
*/
public function mapping() : array
{
return [
'states' => [
Asleep::class,
Awake::class
],
'transitions' => [
WakesUp::class
]
];
}
}