Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class QueryBus implements Interfaces\QueryBus |
||
10 | { |
||
11 | private Interfaces\Resolver $resolver; |
||
12 | |||
13 | /** |
||
14 | * @var callable |
||
15 | */ |
||
16 | private $callStack; |
||
17 | |||
18 | public function __construct(Interfaces\Resolver $resolver) |
||
19 | { |
||
20 | $this->resolver = $resolver; |
||
21 | $this->callStack = $this->seedCallStack(); |
||
22 | } |
||
23 | |||
24 | public static function create(Interfaces\Resolver $resolver): self |
||
25 | { |
||
26 | return new static($resolver); |
||
27 | } |
||
28 | |||
29 | public function pushMiddleware(callable $middleware): Interfaces\QueryBus |
||
38 | } |
||
39 | |||
40 | public function handle(object $query): Interfaces\Result |
||
43 | } |
||
44 | |||
45 | private function seedCallStack(): callable |
||
49 | }; |
||
50 | } |
||
52 |