File tree 7 files changed +20
-14
lines changed
7 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <files psalm-version =" 6.7.1@a2f190972555ea01b0cfcc1913924d6c5fc1a64e " >
2
+ <files psalm-version =" 6.8.4@7ee919229d510c5834af3112072f4b12cd7bb51a " >
3
3
<file src =" src/Aggregate/AggregateRootBehaviour.php" >
4
4
<UnsafeInstantiation >
5
5
<code ><![CDATA[ new static()]]> </code >
83
83
<code ><![CDATA[ require_once $file]]> </code >
84
84
</UnresolvableInclude >
85
85
</file >
86
+ <file src =" src/QueryBus/ServiceHandlerProvider.php" >
87
+ <MixedArgument >
88
+ <code ><![CDATA[ $service::{$handler->method}(...)]]> </code >
89
+ </MixedArgument >
90
+ <MixedMethodCall >
91
+ <code ><![CDATA[ $handler->method]]> </code >
92
+ <code ><![CDATA[ $service::{$handler->method}(...)]]> </code >
93
+ </MixedMethodCall >
94
+ </file >
86
95
<file src =" src/Repository/DefaultRepository.php" >
87
96
<PossiblyNullArgument >
88
97
<code ><![CDATA[ $streamName]]> </code >
Original file line number Diff line number Diff line change 9
9
#[Attribute(Attribute::TARGET_METHOD )]
10
10
final class Answer
11
11
{
12
- /** @param class-string $queryClass */
12
+ /** @param class-string|null $queryClass */
13
13
public function __construct (
14
- public readonly string $ queryClass ,
14
+ public readonly string | null $ queryClass = null ,
15
15
) {
16
16
}
17
17
}
Original file line number Diff line number Diff line change 4
4
5
5
namespace Patchlevel \EventSourcing \QueryBus ;
6
6
7
-
8
7
final class ChainHandlerProvider implements HandlerProvider
9
8
{
10
9
/** @param iterable<HandlerProvider> $providers */
@@ -25,7 +24,7 @@ public function handlerForQuery(string $queryClass): iterable
25
24
foreach ($ this ->providers as $ provider ) {
26
25
$ handlers = [
27
26
...$ handlers ,
28
- ...$ provider ->handlerForCommand ($ queryClass ),
27
+ ...$ provider ->handlerForQuery ($ queryClass ),
29
28
];
30
29
}
31
30
Original file line number Diff line number Diff line change @@ -22,17 +22,17 @@ public static function findInClass(string $classString): iterable
22
22
$ reflectionClass = new ReflectionClass ($ classString );
23
23
24
24
foreach ($ reflectionClass ->getMethods () as $ reflectionMethod ) {
25
- $ handleAttributes = $ reflectionMethod ->getAttributes (Answer::class);
25
+ $ answerAttributes = $ reflectionMethod ->getAttributes (Answer::class);
26
26
27
- if ($ handleAttributes === []) {
27
+ if ($ answerAttributes === []) {
28
28
continue ;
29
29
}
30
30
31
- $ handle = $ handleAttributes [0 ]->newInstance ();
31
+ $ answer = $ answerAttributes [0 ]->newInstance ();
32
32
33
- if ($ handle ->queryClass !== null ) {
33
+ if ($ answer ->queryClass !== null ) {
34
34
yield new HandlerReference (
35
- $ handle ->queryClass ,
35
+ $ answer ->queryClass ,
36
36
$ reflectionMethod ->getName (),
37
37
$ reflectionMethod ->isStatic (),
38
38
);
Original file line number Diff line number Diff line change 4
4
5
5
namespace Patchlevel \EventSourcing \QueryBus ;
6
6
7
- use Patchlevel \EventSourcing \CommandBus \HandlerDescriptor ;
8
-
9
7
interface HandlerProvider
10
8
{
11
9
/**
Original file line number Diff line number Diff line change 6
6
7
7
final class HandlerReference
8
8
{
9
- /** @param class-string $commandClass */
9
+ /** @param class-string $queryClass */
10
10
public function __construct (
11
11
public readonly string $ queryClass ,
12
12
public readonly string $ method ,
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public function __construct(
26
26
}
27
27
}
28
28
29
- /** @throws HandlerNotFound */
29
+ /** @throws InvalidQueryHandler */
30
30
public function dispatch (object $ query ): mixed
31
31
{
32
32
$ this ->logger ?->debug('QueryBus: dispatch query ' , ['query ' => $ query ::class]);
You can’t perform that action at this time.
0 commit comments