From 140b6afa9ec39eac793837a21c0be2a7b62c3844 Mon Sep 17 00:00:00 2001 From: DanielCoulbourne Date: Thu, 7 Nov 2024 19:09:43 +0000 Subject: [PATCH 1/2] Fix styling --- examples/Bank/src/Events/AccountOpened.php | 12 ++++++------ tests/Feature/MountHookTest.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/Bank/src/Events/AccountOpened.php b/examples/Bank/src/Events/AccountOpened.php index 2f106ac7..b8c80b60 100644 --- a/examples/Bank/src/Events/AccountOpened.php +++ b/examples/Bank/src/Events/AccountOpened.php @@ -2,14 +2,14 @@ namespace Thunk\Verbs\Examples\Bank\Events; -use Thunk\Verbs\Event; -use Thunk\Verbs\Facades\Verbs; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Mail; -use Thunk\Verbs\Examples\Bank\Models\Account; -use Thunk\Verbs\Examples\Bank\Mail\WelcomeEmail; use Thunk\Verbs\Attributes\Autodiscovery\StateId; +use Thunk\Verbs\Event; +use Thunk\Verbs\Examples\Bank\Mail\WelcomeEmail; +use Thunk\Verbs\Examples\Bank\Models\Account; use Thunk\Verbs\Examples\Bank\States\AccountState; +use Thunk\Verbs\Facades\Verbs; class AccountOpened extends Event { @@ -44,8 +44,8 @@ public function handle() public static function migrate() { return [ - 1 => fn(Collection $v0) => $v0->except('user_id'), - 2 => fn(Collection $v1) => $v1->merge(['email' => 'default@email.gov']), + 1 => fn (Collection $v0) => $v0->except('user_id'), + 2 => fn (Collection $v1) => $v1->merge(['email' => 'default@email.gov']), ]; } } diff --git a/tests/Feature/MountHookTest.php b/tests/Feature/MountHookTest.php index 3469ef39..9c59209f 100644 --- a/tests/Feature/MountHookTest.php +++ b/tests/Feature/MountHookTest.php @@ -5,7 +5,6 @@ use Thunk\Verbs\Facades\Verbs; use Thunk\Verbs\Lifecycle\Phase; - it('can modify props on events in the mount phase', function () { Verbs::registerListener(Listener::class); @@ -21,6 +20,7 @@ class EventWithNullProp extends Event { public ?string $name = null; + public string $album; } From 4e9a33fe631584e1b15b4f465910abea65295ea5 Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Thu, 7 Nov 2024 15:32:08 -0500 Subject: [PATCH 2/2] Update src/Lifecycle/Dispatcher.php Co-authored-by: Chris Morrell --- src/Lifecycle/Dispatcher.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Lifecycle/Dispatcher.php b/src/Lifecycle/Dispatcher.php index 61bf65b3..2a558318 100644 --- a/src/Lifecycle/Dispatcher.php +++ b/src/Lifecycle/Dispatcher.php @@ -102,7 +102,6 @@ protected function getMountHooks(Event $event): Collection $hooks = $this->hooksFor($event, Phase::Mount); if (method_exists($event, 'mount')) { - dump($event); $hooks->prepend(Hook::fromClassMethod($event, 'mount')->forcePhases(Phase::Mount)); }