@@ -117,6 +117,9 @@ |
||
117 | 117 | ); |
118 | 118 | } |
119 | 119 | |
120 | + /** |
|
121 | + * @param null|\Governor\Framework\Common\Property\PropertyInterface $associationProperty |
|
122 | + */ |
|
120 | 123 | private function __construct( |
121 | 124 | $creationPolicy, |
122 | 125 | $associationKey, |
@@ -87,7 +87,7 @@ |
||
87 | 87 | if (null === $associationProperty) { |
88 | 88 | throw new \RuntimeException( |
89 | 89 | sprintf( |
90 | - "SagaEventHandler %s::%s defines a property %s that is not ". |
|
90 | + "SagaEventHandler %s::%s defines a property %s that is not " . |
|
91 | 91 | "defined on the Event it declares to handle (%s)", |
92 | 92 | $handlerMethod->class, |
93 | 93 | $handlerMethod->name, |
@@ -231,6 +231,9 @@ |
||
231 | 231 | } |
232 | 232 | |
233 | 233 | |
234 | + /** |
|
235 | + * @param string $type |
|
236 | + */ |
|
234 | 237 | private function associationValueQuery($type, AssociationValue $associationValue) |
235 | 238 | { |
236 | 239 | return [ |
@@ -26,7 +26,6 @@ |
||
26 | 26 | |
27 | 27 | use Psr\Log\LoggerInterface; |
28 | 28 | use Psr\Log\LoggerAwareInterface; |
29 | -use Doctrine\ORM\Query; |
|
30 | 29 | use Doctrine\ORM\EntityManager; |
31 | 30 | use Doctrine\ORM\NoResultException; |
32 | 31 | use Governor\Framework\Saga\Repository\AbstractSagaRepository; |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | $sagaIdentifier |
133 | 133 | ) { |
134 | 134 | $updateCount = $this->entityManager->createQuery( |
135 | - "DELETE FROM ". |
|
136 | - " Governor\Framework\Saga\Repository\Orm\AssociationValueEntry ae ". |
|
137 | - "WHERE ae.associationKey = :associationKey ". |
|
138 | - "AND ae.associationValue = :associationValue ". |
|
139 | - "AND ae.sagaType = :sagaType ". |
|
135 | + "DELETE FROM " . |
|
136 | + " Governor\Framework\Saga\Repository\Orm\AssociationValueEntry ae " . |
|
137 | + "WHERE ae.associationKey = :associationKey " . |
|
138 | + "AND ae.associationValue = :associationValue " . |
|
139 | + "AND ae.sagaType = :sagaType " . |
|
140 | 140 | "AND ae.sagaId = :sagaId" |
141 | 141 | ) |
142 | 142 | ->setParameters( |
@@ -190,10 +190,10 @@ discard block |
||
190 | 190 | AssociationValue $associationValue |
191 | 191 | ) { |
192 | 192 | $entries = $this->entityManager->createQuery( |
193 | - "SELECT ae.sagaId FROM ". |
|
194 | - "Governor\Framework\Saga\Repository\Orm\AssociationValueEntry ae ". |
|
195 | - "WHERE ae.associationKey = :associationKey ". |
|
196 | - "AND ae.associationValue = :associationValue ". |
|
193 | + "SELECT ae.sagaId FROM " . |
|
194 | + "Governor\Framework\Saga\Repository\Orm\AssociationValueEntry ae " . |
|
195 | + "WHERE ae.associationKey = :associationKey " . |
|
196 | + "AND ae.associationValue = :associationValue " . |
|
197 | 197 | "AND ae.sagaType = :sagaType" |
198 | 198 | ) |
199 | 199 | ->setParameters( |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | ); |
239 | 239 | |
240 | 240 | $updateCount = $this->entityManager->createQuery( |
241 | - "UPDATE Governor\Framework\Saga\Repository\Orm\SagaEntry s ". |
|
242 | - "SET s.serializedSaga = :serializedSaga, s.revision = :revision ". |
|
241 | + "UPDATE Governor\Framework\Saga\Repository\Orm\SagaEntry s " . |
|
242 | + "SET s.serializedSaga = :serializedSaga, s.revision = :revision " . |
|
243 | 243 | "WHERE s.sagaId = :sagaId AND s.sagaType = :sagaType" |
244 | 244 | ) |
245 | 245 | ->setParameters( |
@@ -9,7 +9,6 @@ |
||
9 | 9 | namespace Governor\Framework\Serializer; |
10 | 10 | |
11 | 11 | use Governor\Framework\Domain\MessageInterface; |
12 | -use Governor\Framework\Domain\MetaData; |
|
13 | 12 | |
14 | 13 | /** |
15 | 14 | * Description of MessageSerializer |
@@ -61,7 +61,7 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | - * @return null|string |
|
64 | + * @return string |
|
65 | 65 | */ |
66 | 66 | public function getRevision() |
67 | 67 | { |
@@ -592,6 +592,9 @@ discard block |
||
592 | 592 | private $givenEvents; |
593 | 593 | private $aggregateIdentifier; |
594 | 594 | |
595 | + /** |
|
596 | + * @param string $aggregateIdentifier |
|
597 | + */ |
|
595 | 598 | public function __construct( |
596 | 599 | array &$storedEvents, |
597 | 600 | array &$givenEvents, |
@@ -703,6 +706,9 @@ discard block |
||
703 | 706 | { |
704 | 707 | private $workingAggregate; |
705 | 708 | |
709 | + /** |
|
710 | + * @param AggregateRootInterface $workingAggregate |
|
711 | + */ |
|
706 | 712 | function __construct(&$workingAggregate) |
707 | 713 | { |
708 | 714 | $this->workingAggregate = &$workingAggregate; |
@@ -241,9 +241,9 @@ discard block |
||
241 | 241 | { |
242 | 242 | if ($this->explicitCommandHandlersSet) { |
243 | 243 | throw new FixtureExecutionException( |
244 | - "Cannot inject resources after command handler has been created. ". |
|
245 | - "Configure all resource before calling ". |
|
246 | - "registerCommandHandler() or ". |
|
244 | + "Cannot inject resources after command handler has been created. " . |
|
245 | + "Configure all resource before calling " . |
|
246 | + "registerCommandHandler() or " . |
|
247 | 247 | "registerAnnotatedCommandHandler()" |
248 | 248 | ); |
249 | 249 | } |
@@ -383,9 +383,9 @@ discard block |
||
383 | 383 | $aggregate2 = $this->repository->load($this->aggregateIdentifier); |
384 | 384 | if ($this->workingAggregate->isDeleted()) { |
385 | 385 | throw new GovernorAssertionError( |
386 | - "The working aggregate was considered deleted, ". |
|
387 | - "but the Repository still contains a non-deleted copy of ". |
|
388 | - "the aggregate. Make sure the aggregate explicitly marks ". |
|
386 | + "The working aggregate was considered deleted, " . |
|
387 | + "but the Repository still contains a non-deleted copy of " . |
|
388 | + "the aggregate. Make sure the aggregate explicitly marks " . |
|
389 | 389 | "itself as deleted in an EventHandler." |
390 | 390 | ); |
391 | 391 | } |
@@ -393,8 +393,8 @@ discard block |
||
393 | 393 | } catch (AggregateNotFoundException $notFound) { |
394 | 394 | if (!$this->workingAggregate->isDeleted()) { |
395 | 395 | throw new GovernorAssertionError( |
396 | - "The working aggregate was not considered deleted, ". |
|
397 | - "but the Repository cannot recover the state of the ". |
|
396 | + "The working aggregate was not considered deleted, " . |
|
397 | + "but the Repository cannot recover the state of the " . |
|
398 | 398 | "aggregate, as it is considered deleted there." |
399 | 399 | ); |
400 | 400 | } |
@@ -537,8 +537,8 @@ discard block |
||
537 | 537 | if (null !== $aggregateIdentifier && !$aggregateIdentifier === $aggregate->getIdentifier()) { |
538 | 538 | throw new \RuntimeException( |
539 | 539 | sprintf( |
540 | - "The aggregate used in this fixture was initialized with an identifier different than ". |
|
541 | - "the one used to load it. Loaded [%s], but actual identifier is [%s].\n". |
|
540 | + "The aggregate used in this fixture was initialized with an identifier different than " . |
|
541 | + "the one used to load it. Loaded [%s], but actual identifier is [%s].\n" . |
|
542 | 542 | "Make sure the identifier passed in the Command matches that of the given Events.", |
543 | 543 | $aggregateIdentifier, |
544 | 544 | $aggregate->getIdentifier() |
@@ -613,14 +613,14 @@ discard block |
||
613 | 613 | |
614 | 614 | if ($lastEvent->getAggregateIdentifier() !== $next->getAggregateIdentifier()) { |
615 | 615 | throw new EventStoreException( |
616 | - "Writing events for an unexpected aggregate. This could ". |
|
616 | + "Writing events for an unexpected aggregate. This could " . |
|
617 | 617 | "indicate that a wrong aggregate is being triggered." |
618 | 618 | ); |
619 | 619 | } else { |
620 | 620 | if ($lastEvent->getScn() !== $next->getScn() - 1) { |
621 | 621 | throw new EventStoreException( |
622 | 622 | sprintf( |
623 | - "Unexpected sequence number on stored event. ". |
|
623 | + "Unexpected sequence number on stored event. " . |
|
624 | 624 | "Expected %s, but got %s.", |
625 | 625 | $lastEvent->getScn() + 1, |
626 | 626 | $next->getScn() |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | |
648 | 648 | if (null !== $this->aggregateIdentifier && $this->aggregateIdentifier !== $identifier) { |
649 | 649 | throw new EventStoreException( |
650 | - "You probably want to use aggregateIdentifier() on your fixture ". |
|
650 | + "You probably want to use aggregateIdentifier() on your fixture " . |
|
651 | 651 | "to get the aggregate identifier to use" |
652 | 652 | ); |
653 | 653 | } else { |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | if (empty($allEvents)) { |
664 | 664 | throw new AggregateNotFoundException( |
665 | 665 | $identifier, |
666 | - "No 'given' events were configured for this aggregate, ". |
|
666 | + "No 'given' events were configured for this aggregate, " . |
|
667 | 667 | "nor have any events been stored." |
668 | 668 | ); |
669 | 669 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | private $eventListenerRegistry; |
49 | 49 | |
50 | 50 | /** |
51 | - * @param array $publishedEvents |
|
51 | + * @param EventMessageInterface[] $publishedEvents |
|
52 | 52 | */ |
53 | 53 | public function __construct(array &$publishedEvents) |
54 | 54 | { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | /** |
75 | 75 | * Returns the EventListenerRegistryInterface of this EventBus. |
76 | 76 | * |
77 | - * @return EventListenerRegistryInterface |
|
77 | + * @return EventListenerRegistryInterface[] |
|
78 | 78 | */ |
79 | 79 | public function getEventListenerRegistry() |
80 | 80 | { |
@@ -182,6 +182,9 @@ |
||
182 | 182 | $this->listeners->add($listener); |
183 | 183 | } |
184 | 184 | |
185 | + /** |
|
186 | + * @param string $aggregateType |
|
187 | + */ |
|
185 | 188 | private function findSimilarAggregate($aggregateType, $identifier) |
186 | 189 | { |
187 | 190 | foreach ($this->registeredAggregates as $hash => $aggregateEntry) { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | if (null !== $similarAggregate) { |
144 | 144 | |
145 | 145 | $this->logger->info( |
146 | - "Ignoring aggregate registration. An aggregate of same type and identifier was already". |
|
146 | + "Ignoring aggregate registration. An aggregate of same type and identifier was already" . |
|
147 | 147 | "registered in this Unit Of Work: type [{aggregate}], identifier [{identifier}]", |
148 | 148 | array('aggregate' => get_class($aggregateRoot), 'identifier' => $aggregateRoot->getIdentifier()) |
149 | 149 | ); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | $uow = $this; |
155 | 155 | $eventRegistrationCallback = new UoWEventRegistrationCallback( |
156 | - function (DomainEventMessageInterface $event) use ($uow, $eventBus) { |
|
156 | + function(DomainEventMessageInterface $event) use ($uow, $eventBus) { |
|
157 | 157 | $event = $uow->invokeEventRegistrationListeners($event); |
158 | 158 | $uow->eventsToPublishOn($event, $eventBus); |
159 | 159 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | if ($this->dispatcherStatus == self::STATUS_DISPATCHING) { |
235 | 235 | // this prevents events from overtaking each other |
236 | 236 | $this->logger->debug( |
237 | - "UnitOfWork is already in the dispatch process. ". |
|
237 | + "UnitOfWork is already in the dispatch process. " . |
|
238 | 238 | "That process will publish events instead. Aborting..." |
239 | 239 | ); |
240 | 240 |
@@ -291,9 +291,9 @@ |
||
291 | 291 | private $rollbackClosure; |
292 | 292 | |
293 | 293 | /** |
294 | - * @param callable $commitClosure |
|
295 | - * @param callable $cleanupClosure |
|
296 | - * @param callable $rollbackClosure |
|
294 | + * @param \Closure $commitClosure |
|
295 | + * @param \Closure $cleanupClosure |
|
296 | + * @param \Closure $rollbackClosure |
|
297 | 297 | */ |
298 | 298 | function __construct( |
299 | 299 | \Closure $commitClosure, |
@@ -116,13 +116,13 @@ |
||
116 | 116 | $this->outerUnitOfWork->registerInnerUnitOfWork($this); |
117 | 117 | } else { |
118 | 118 | $listener = new CommitOnOuterCommitTask( |
119 | - function (UnitOfWorkInterface $uow) { |
|
119 | + function(UnitOfWorkInterface $uow) { |
|
120 | 120 | $this->performInnerCommit(); |
121 | 121 | }, |
122 | - function (UnitOfWorkInterface $uow) { |
|
122 | + function(UnitOfWorkInterface $uow) { |
|
123 | 123 | $this->performCleanup(); |
124 | 124 | }, |
125 | - function (UnitOfWorkInterface $uow, \Exception $ex = null) { |
|
125 | + function(UnitOfWorkInterface $uow, \Exception $ex = null) { |
|
126 | 126 | CurrentUnitOfWork::set($this); |
127 | 127 | $this->rollback($ex); |
128 | 128 | } |