Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved type information with psalm annotations on query and command buses #15

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/CommandBusInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@

interface CommandBusInterface
{
/**
* @template TResult
* @param CommandInterface<TResult> $command
*
* @return TResult
*/
public function dispatch(CommandInterface $command): mixed;
}
3 changes: 3 additions & 0 deletions src/CommandInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Spiral\Cqrs;

/**
* @template TResult
*/
interface CommandInterface
{

Expand Down
6 changes: 6 additions & 0 deletions src/QueryBusInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@

interface QueryBusInterface
{
/**
* @template TResult
* @param QueryInterface<TResult> $query
*
* @return TResult
*/
public function ask(QueryInterface $query): mixed;
}
3 changes: 3 additions & 0 deletions src/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Spiral\Cqrs;

/**
* @template TResult
*/
interface QueryInterface
{

Expand Down
Loading