Skip to content

Commit

Permalink
feat: adds __invoke method to QueryBus
Browse files Browse the repository at this point in the history
  • Loading branch information
matiux committed Oct 24, 2022
1 parent bcce4d9 commit 41551f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Expand Up @@ -11,7 +11,7 @@
use Symfony\Component\Messenger\MessageBusInterface;
use Webmozart\Assert\Assert;

class SymfonyQueryBus implements QueryBus
class SymfonyQueryBus extends QueryBus
{
use HandleTrait;

Expand Down
9 changes: 7 additions & 2 deletions src/Matiux/DDDStarterPack/Query/QueryBus.php
Expand Up @@ -4,7 +4,12 @@

namespace DDDStarterPack\Query;

interface QueryBus
abstract class QueryBus
{
public function query(Query $query): mixed;
abstract public function query(Query $query): mixed;

public function __invoke(Query $query): mixed
{
return $this->query($query);
}
}

0 comments on commit 41551f3

Please sign in to comment.