From 5548e77032bd8844e08e74c901d5de3e09635c9d Mon Sep 17 00:00:00 2001 From: deligoez Date: Tue, 13 Aug 2024 11:04:23 +0000 Subject: [PATCH] chore: Fix styling --- src/Behavior/ActionBehavior.php | 4 +--- src/Behavior/GuardBehavior.php | 4 +--- src/Behavior/ResultBehavior.php | 4 +--- src/ContextManager.php | 3 +-- src/EventCollection.php | 4 +--- src/Exceptions/MachineContextValidationException.php | 4 +--- src/Exceptions/MachineEventValidationException.php | 4 +--- src/Exceptions/MachineValidationException.php | 4 +--- .../TrafficLights/Actions/DoNothingInsideClassAction.php | 4 +--- tests/Stubs/Machines/TrafficLights/TrafficLightsMachine.php | 6 ++---- 10 files changed, 11 insertions(+), 30 deletions(-) diff --git a/src/Behavior/ActionBehavior.php b/src/Behavior/ActionBehavior.php index 086181f9..c29d05ce 100644 --- a/src/Behavior/ActionBehavior.php +++ b/src/Behavior/ActionBehavior.php @@ -10,6 +10,4 @@ * This abstract class extends the InvokableBehavior class. It provides a way to define action behaviors * that can be invoked within a specific context. */ -abstract class ActionBehavior extends InvokableBehavior -{ -} +abstract class ActionBehavior extends InvokableBehavior {} diff --git a/src/Behavior/GuardBehavior.php b/src/Behavior/GuardBehavior.php index 015f5f63..f64bdc03 100644 --- a/src/Behavior/GuardBehavior.php +++ b/src/Behavior/GuardBehavior.php @@ -10,6 +10,4 @@ * This is an abstract class that extends InvokableBehavior and provides the base structure for guard behavior classes. * Guards are used in event-driven systems to determine whether an event should be allowed to proceed or not. */ -abstract class GuardBehavior extends InvokableBehavior -{ -} +abstract class GuardBehavior extends InvokableBehavior {} diff --git a/src/Behavior/ResultBehavior.php b/src/Behavior/ResultBehavior.php index 2551a83c..3188ed14 100644 --- a/src/Behavior/ResultBehavior.php +++ b/src/Behavior/ResultBehavior.php @@ -4,6 +4,4 @@ namespace Tarfinlabs\EventMachine\Behavior; -abstract class ResultBehavior extends InvokableBehavior -{ -} +abstract class ResultBehavior extends InvokableBehavior {} diff --git a/src/ContextManager.php b/src/ContextManager.php index 1d659724..b323fcda 100644 --- a/src/ContextManager.php +++ b/src/ContextManager.php @@ -28,8 +28,7 @@ class ContextManager extends Data public function __construct( #[ArrayType] public array|Optional $data = [], - ) { - } + ) {} /** * Get a value from the context by its key. diff --git a/src/EventCollection.php b/src/EventCollection.php index 23d178ec..4ddd2f4f 100644 --- a/src/EventCollection.php +++ b/src/EventCollection.php @@ -6,6 +6,4 @@ use Illuminate\Database\Eloquent\Collection; -class EventCollection extends Collection -{ -} +class EventCollection extends Collection {} diff --git a/src/Exceptions/MachineContextValidationException.php b/src/Exceptions/MachineContextValidationException.php index 7cabc48d..d3b9cefa 100644 --- a/src/Exceptions/MachineContextValidationException.php +++ b/src/Exceptions/MachineContextValidationException.php @@ -9,6 +9,4 @@ /** * Represents an exception thrown when the validation of the machine context fails. */ -class MachineContextValidationException extends ValidationException -{ -} +class MachineContextValidationException extends ValidationException {} diff --git a/src/Exceptions/MachineEventValidationException.php b/src/Exceptions/MachineEventValidationException.php index 01fe142f..83ca2d82 100644 --- a/src/Exceptions/MachineEventValidationException.php +++ b/src/Exceptions/MachineEventValidationException.php @@ -11,6 +11,4 @@ * * This class represents an exception that is thrown when a validation error occurs while processing a machine event. */ -class MachineEventValidationException extends ValidationException -{ -} +class MachineEventValidationException extends ValidationException {} diff --git a/src/Exceptions/MachineValidationException.php b/src/Exceptions/MachineValidationException.php index c417d76e..cbfc376f 100644 --- a/src/Exceptions/MachineValidationException.php +++ b/src/Exceptions/MachineValidationException.php @@ -12,6 +12,4 @@ * This exception is used to handle validation errors specific to the Machine class. * It extends the ValidationException class to provide more specific functionality. */ -class MachineValidationException extends ValidationException -{ -} +class MachineValidationException extends ValidationException {} diff --git a/tests/Stubs/Machines/TrafficLights/Actions/DoNothingInsideClassAction.php b/tests/Stubs/Machines/TrafficLights/Actions/DoNothingInsideClassAction.php index bc2efed6..179f2dfa 100644 --- a/tests/Stubs/Machines/TrafficLights/Actions/DoNothingInsideClassAction.php +++ b/tests/Stubs/Machines/TrafficLights/Actions/DoNothingInsideClassAction.php @@ -8,7 +8,5 @@ class DoNothingInsideClassAction extends ActionBehavior { - public function __invoke(): void - { - } + public function __invoke(): void {} } diff --git a/tests/Stubs/Machines/TrafficLights/TrafficLightsMachine.php b/tests/Stubs/Machines/TrafficLights/TrafficLightsMachine.php index 11ad772b..ff33129e 100644 --- a/tests/Stubs/Machines/TrafficLights/TrafficLightsMachine.php +++ b/tests/Stubs/Machines/TrafficLights/TrafficLightsMachine.php @@ -58,10 +58,8 @@ public static function definition(): MachineDefinition 'DEX' => DecreaseEvent::class, ], 'actions' => [ - 'doNothingAction' => function (): void { - }, - 'doNothingAction2' => function (ContextManager $context, EventBehavior $eventBehavior): void { - }, + 'doNothingAction' => function (): void {}, + 'doNothingAction2' => function (ContextManager $context, EventBehavior $eventBehavior): void {}, 'doNothingInsideClassAction' => DoNothingInsideClassAction::class, ], ],