@@ -25,7 +25,6 @@ |
||
25 | 25 | namespace Governor\Framework\CommandHandling\Distributed; |
26 | 26 | |
27 | 27 | use Governor\Framework\CommandHandling\Callbacks\ClosureCommandCallback; |
28 | -use Governor\Framework\CommandHandling\Callbacks\ResultCallback; |
|
29 | 28 | use Governor\Framework\Common\ReceiverInterface; |
30 | 29 | use Governor\Framework\CommandHandling\CommandBusInterface; |
31 | 30 | use Governor\Framework\Serializer\SerializerInterface; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $dispatchMessage = DispatchMessage::fromBytes($this->serializer, $data[1]); |
105 | 105 | $self = $this; |
106 | 106 | |
107 | - $successCallback = function ($result) use ($dispatchMessage, $self) { |
|
107 | + $successCallback = function($result) use ($dispatchMessage, $self) { |
|
108 | 108 | $message = new ReplyMessage( |
109 | 109 | $dispatchMessage->getCommandIdentifier(), |
110 | 110 | $self->serializer, |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $self->template->writeCommandReply($dispatchMessage->getCommandIdentifier(), $message->toBytes()); |
115 | 115 | }; |
116 | 116 | |
117 | - $failureCallback = function (\Exception $cause) use ($dispatchMessage, $self) { |
|
117 | + $failureCallback = function(\Exception $cause) use ($dispatchMessage, $self) { |
|
118 | 118 | $message = new ReplyMessage( |
119 | 119 | $dispatchMessage->getCommandIdentifier(), |
120 | 120 | $self->serializer, |
@@ -23,7 +23,6 @@ |
||
23 | 23 | |
24 | 24 | namespace Governor\Framework\CommandHandling\Distributed; |
25 | 25 | |
26 | -use Governor\Framework\CommandHandling\Callbacks\NoOpCallback; |
|
27 | 26 | use Governor\Framework\CommandHandling\CommandBusInterface; |
28 | 27 | use Governor\Framework\CommandHandling\CommandCallbackInterface; |
29 | 28 | use Governor\Framework\CommandHandling\CommandHandlerInterface; |
@@ -94,7 +94,7 @@ |
||
94 | 94 | $this->connector->send($routingKey, $command, $callback); |
95 | 95 | } catch (\Exception $ex) { |
96 | 96 | $this->logger->error( |
97 | - self::DISPATCH_ERROR_MESSAGE.' {err}', |
|
97 | + self::DISPATCH_ERROR_MESSAGE . ' {err}', |
|
98 | 98 | [ |
99 | 99 | 'err' => $ex->getMessage() |
100 | 100 | ] |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | /** |
145 | 145 | * @param string $commandIdentifier |
146 | - * @param mixed $reply |
|
146 | + * @param string $reply |
|
147 | 147 | */ |
148 | 148 | public function writeCommandReply($commandIdentifier, $reply) |
149 | 149 | { |
@@ -200,11 +200,18 @@ discard block |
||
200 | 200 | ); |
201 | 201 | } |
202 | 202 | |
203 | + /** |
|
204 | + * @param string $commandName |
|
205 | + */ |
|
203 | 206 | public static function hashCommandName($commandName) |
204 | 207 | { |
205 | 208 | return hash('md5', $commandName); |
206 | 209 | } |
207 | 210 | |
211 | + /** |
|
212 | + * @param string $commandName |
|
213 | + * @param string $routingKey |
|
214 | + */ |
|
208 | 215 | public static function hashCommandRouting($commandName, $routingKey) |
209 | 216 | { |
210 | 217 | return hash('md5', sprintf('%s-%s', $commandName, $routingKey)); |
@@ -24,15 +24,15 @@ |
||
24 | 24 | |
25 | 25 | namespace Governor\Framework\CommandHandling\Handlers; |
26 | 26 | |
27 | -use Governor\Framework\Common\Annotation\AnnotationReaderFactoryInterface; |
|
28 | -use Governor\Framework\Annotations\CommandHandler; |
|
29 | -use Governor\Framework\Common\ParameterResolverFactoryInterface; |
|
30 | -use Governor\Framework\Common\Annotation\MethodMessageHandlerInspector; |
|
31 | -use Governor\Framework\CommandHandling\CommandBusInterface; |
|
32 | -use Governor\Framework\CommandHandling\CommandMessageInterface; |
|
33 | -use Governor\Framework\CommandHandling\CommandTargetResolverInterface; |
|
34 | -use Governor\Framework\CommandHandling\AnnotationCommandTargetResolver; |
|
35 | -use Governor\Framework\UnitOfWork\UnitOfWorkInterface; |
|
27 | +use Governor\Framework\Common\Annotation\AnnotationReaderFactoryInterface; |
|
28 | +use Governor\Framework\Annotations\CommandHandler; |
|
29 | +use Governor\Framework\Common\ParameterResolverFactoryInterface; |
|
30 | +use Governor\Framework\Common\Annotation\MethodMessageHandlerInspector; |
|
31 | +use Governor\Framework\CommandHandling\CommandBusInterface; |
|
32 | +use Governor\Framework\CommandHandling\CommandMessageInterface; |
|
33 | +use Governor\Framework\CommandHandling\CommandTargetResolverInterface; |
|
34 | +use Governor\Framework\CommandHandling\AnnotationCommandTargetResolver; |
|
35 | +use Governor\Framework\UnitOfWork\UnitOfWorkInterface; |
|
36 | 36 | use Governor\Framework\Repository\RepositoryInterface; |
37 | 37 | |
38 | 38 | /** |
@@ -60,6 +60,9 @@ |
||
60 | 60 | return $message->getMetaData()->get($this->getKey()); |
61 | 61 | } |
62 | 62 | |
63 | + /** |
|
64 | + * @return string |
|
65 | + */ |
|
63 | 66 | private function getKey() |
64 | 67 | { |
65 | 68 | // !!! TODO check types on primitives ? |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | namespace Governor\Framework\Common; |
26 | 26 | |
27 | -use Governor\Framework\Domain\MessageInterface; |
|
27 | +use Governor\Framework\Domain\MessageInterface; |
|
28 | 28 | use Governor\Framework\Annotations\MetaData; |
29 | 29 | /** |
30 | 30 | * Description of AnnotatedMetaDataParameterResolver |
@@ -39,9 +39,9 @@ |
||
39 | 39 | */ |
40 | 40 | private $annotation; |
41 | 41 | |
42 | - /** |
|
43 | - * @var \ReflectionParameter |
|
44 | - */ |
|
42 | + /** |
|
43 | + * @var \ReflectionParameter |
|
44 | + */ |
|
45 | 45 | private $parameter; |
46 | 46 | |
47 | 47 | public function __construct(MetaData $annotation, \ReflectionParameter $parameter) |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | namespace Governor\Framework\Common\Annotation; |
26 | 26 | |
27 | -use Doctrine\Common\Annotations\Reader; |
|
27 | +use Doctrine\Common\Annotations\Reader; |
|
28 | 28 | use Governor\Framework\Common\ReflectionUtils; |
29 | 29 | |
30 | 30 | /** |
@@ -54,7 +54,7 @@ |
||
54 | 54 | /** |
55 | 55 | * Returns an array of registered EventListenerInterface-s. |
56 | 56 | * |
57 | - * @return \SplObjectStorage|EventListenerInterface[] |
|
57 | + * @return \SplObjectStorage |
|
58 | 58 | */ |
59 | 59 | public function getListeners() |
60 | 60 | { |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the SmartGecko(c) business platform. |
|
4 | - * |
|
5 | - * For the full copyright and license information, please view the LICENSE |
|
6 | - * file that was distributed with this source code. |
|
7 | - */ |
|
3 | + * This file is part of the SmartGecko(c) business platform. |
|
4 | + * |
|
5 | + * For the full copyright and license information, please view the LICENSE |
|
6 | + * file that was distributed with this source code. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace Governor\Framework\EventStore\Mongo; |
10 | 10 |
@@ -41,6 +41,9 @@ |
||
41 | 41 | private $methodName; |
42 | 42 | private $eventTarget; |
43 | 43 | |
44 | + /** |
|
45 | + * @param string $eventName |
|
46 | + */ |
|
44 | 47 | function __construct($eventName, $methodName, $eventTarget) |
45 | 48 | { |
46 | 49 | $this->eventName = $eventName; |
@@ -129,6 +129,9 @@ |
||
129 | 129 | $this->eventStore->appendEvents($this->getTypeIdentifier(), $eventStream); |
130 | 130 | } |
131 | 131 | |
132 | + /** |
|
133 | + * @param string $className |
|
134 | + */ |
|
132 | 135 | private function validateEventSourcedAggregate($className) |
133 | 136 | { |
134 | 137 | $reflClass = new \ReflectionClass($className); |