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

using messenger HandleTrait as QueryBus with appropriate result typing #423

Draft
wants to merge 1 commit into
base: 1.4.x
Choose a base branch
from

Conversation

bnowak
Copy link
Contributor

@bnowak bnowak commented Jan 17, 2025

This PR goal is to determine correct result typing for QueryBus kind of classes which uses SF messenger HandleTrait internally and simply return its results.

Comment on lines +116 to +121
use HandleTrait;

public function dispatch(object $query): mixed
{
return $this->handle($query);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also add this test case with changed function name.

Suggested change
use HandleTrait;
public function dispatch(object $query): mixed
{
return $this->handle($query);
}
use HandleTrait {
handle as private handleQuery;
}
public function handle(object $query): mixed
{
return $this->handleQuery($query);
}

@michaljusiega
Copy link

@ondrejmirtes Sorry to disturb you, but I think this is one of the pieces that is missing in this whole puzzle to support. Can we move forward ?

@bnowak
Copy link
Contributor Author

bnowak commented Mar 14, 2025

Hi @michaljusiega, thanks for your reply. I think we can add it - no problem. However, from my perspective it's more important to address the root issue (missing feature) of the topic (described here). My reasoning is without having this result interpreted on bus class level - this is much less useful in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants