Completed
Push — master ( 258d90...7630d0 )
by David
04:59
created
src/Governor/Framework/Saga/Repository/Orm/OrmSagaRepository.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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(
Please login to merge, or discard this patch.
src/Governor/Framework/Serializer/MessageSerializer.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Governor/Framework/Serializer/SimpleSerializedType.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     }
62 62
 
63 63
     /**
64
-     * @return null|string
64
+     * @return string
65 65
      */
66 66
     public function getRevision()
67 67
     {
Please login to merge, or discard this patch.
src/Governor/Framework/Test/GivenWhenThenTestFixture.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -592,6 +592,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -241,9 +241,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Governor/Framework/Test/Utils/RecordingEventBus.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/Governor/Framework/UnitOfWork/DefaultUnitOfWork.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -182,6 +182,9 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Governor/Framework/UnitOfWork/NestableUnitOfWork.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -291,9 +291,9 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -116,13 +116,13 @@
 block discarded – undo
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
                     }
Please login to merge, or discard this patch.
src/Governor/Framework/CommandHandling/AnnotationCommandTargetResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,8 @@
 block discarded – undo
67 67
         if (null === $id) {
68 68
             throw new \InvalidArgumentException(
69 69
                 sprintf(
70
-                    "Invalid command. It does not identify the target aggregate. ".
71
-                    "Make sure at least one of the fields or methods in the [%s] class contains the ".
70
+                    "Invalid command. It does not identify the target aggregate. " .
71
+                    "Make sure at least one of the fields or methods in the [%s] class contains the " .
72 72
                     "@TargetAggregateIdentifier annotation and that it returns a non-null value.",
73 73
                     $command->getPayloadType()
74 74
                 )
Please login to merge, or discard this patch.
Governor/Framework/CommandHandling/CommandDispatchInterceptorInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
  */
35 35
 interface CommandDispatchInterceptorInterface
36 36
 {
37
-   /**
37
+    /**
38 38
      * Invoked each time a command is about to be dispatched on a Command Bus. The given <code>commandMessage</code>
39 39
      * represents the command being dispatched.
40 40
      *
Please login to merge, or discard this patch.