Skip to content

Commit

Permalink
Merge pull request #354 from zackrowe/fix-aggregate-root-arguments-wi…
Browse files Browse the repository at this point in the history
…th-no-type-hint

Update AggregateRoot::apply() to utilize acceptsTypes() function
  • Loading branch information
freekmurze authored Jul 29, 2022
2 parents 41702ca + d6ce226 commit 09fcc83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"illuminate/events": "^9.0",
"illuminate/support": "^9.0",
"phpdocumentor/reflection-docblock": "^5.2",
"spatie/better-types": "^0.1.0",
"spatie/better-types": "^0.1.2",
"spatie/laravel-package-tools": "^1.9",
"spatie/laravel-schemaless-attributes": "^2.0",
"symfony/finder": "^6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/AggregateRoots/AggregateRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected function apply(ShouldBeStored $event): void
->public()
->protected()
->reject(fn (Method $method) => in_array($method->getName(), ['handleCommand', 'recordThat', 'apply', 'tap']))
->accepts($event)
->acceptsTypes([$event::class])
->all()
->each(fn (Method $method) => $this->{$method->getName()}($event));

Expand Down

0 comments on commit 09fcc83

Please sign in to comment.