generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa807d4
commit 3be7da4
Showing
5 changed files
with
92 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tarfinlabs\EventMachine\Tests\Stubs\Machines\Yns\Actions; | ||
|
||
use Tarfinlabs\EventMachine\Behavior\ActionBehavior; | ||
use Tarfinlabs\EventMachine\Tests\Stubs\Models\ModelA; | ||
|
||
class YAction extends ActionBehavior | ||
{ | ||
public function __invoke(): void | ||
{ | ||
ModelA::create([ | ||
'value' => 'lorem ipsum dolor', | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tarfinlabs\EventMachine\Tests\Stubs\Machines\Yns\Events; | ||
|
||
use Tarfinlabs\EventMachine\Behavior\EventBehavior; | ||
|
||
class SEvent extends EventBehavior | ||
{ | ||
public static function getType(): string | ||
{ | ||
return 'S_EVENT'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tarfinlabs\EventMachine\Tests\Stubs\Machines\Yns; | ||
|
||
use Tarfinlabs\EventMachine\Actor\Machine; | ||
use Tarfinlabs\EventMachine\Definition\MachineDefinition; | ||
use Tarfinlabs\EventMachine\Tests\Stubs\Machines\Yns\Events\SEvent; | ||
use Tarfinlabs\EventMachine\Tests\Stubs\Machines\Yns\Actions\YAction; | ||
|
||
class YnsMachine extends Machine | ||
{ | ||
public static function definition(): MachineDefinition | ||
{ | ||
return MachineDefinition::define(config: [ | ||
'should_persist' => false, | ||
'initial' => 'stateY', | ||
'states' => [ | ||
'stateY' => [ | ||
'on' => [ | ||
SEvent::class => [ | ||
'target' => 'stateS', | ||
'actions' => [YAction::class], | ||
], | ||
], | ||
], | ||
'stateS' => [], | ||
], | ||
]); | ||
} | ||
} |