Completed
Pull Request — develop (#311)
by
unknown
17:12
created
module/Core/src/Core/Entity/Collection/AttachedEntitiesCollection.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -48,6 +48,7 @@
 block discarded – undo
48 48
     /**
49 49
      * {@inheritDoc}
50 50
      * @see \Doctrine\Common\Collections\ArrayCollection::set()
51
+     * @param IdentifiableEntityInterface $entity
51 52
      */
52 53
     public function setAttachedEntity($key, $entity)
53 54
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function setAttachedEntity($key, $entity)
53 53
     {
54
-        if (! $entity instanceof IdentifiableEntityInterface) {
54
+        if (!$entity instanceof IdentifiableEntityInterface) {
55 55
             throw new InvalidArgumentException(sprintf('$entity must be instance of %s', IdentifiableEntityInterface::class));
56 56
         }
57 57
         
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $entityId = $entity->getId();
66 66
         
67 67
         // check if entity is not persisted
68
-        if (! $entityId) {
68
+        if (!$entityId) {
69 69
             // persist entity & retrieve its ID
70 70
             $this->repositories->getRepository($className)
71 71
                 ->store($entity);
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $reference = parent::get($key);
88 88
         
89
-        if (! $reference) {
89
+        if (!$reference) {
90 90
             return;
91 91
         }
92 92
         
93 93
         $entity = $this->doGetEntity($reference);
94 94
         
95
-        if (! $entity) {
95
+        if (!$entity) {
96 96
             // remove reference if entity does not exists
97 97
             unset($this->elements[$key]);
98 98
         }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $reference = parent::remove($key);
110 110
         
111
-        if (! $reference) {
111
+        if (!$reference) {
112 112
             return;
113 113
         }
114 114
         
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $length = $criteria->getMaxResults();
194 194
     
195 195
         if ($offset || $length) {
196
-            $filtered = array_slice($filtered, (int)$offset, $length);
196
+            $filtered = array_slice($filtered, (int) $offset, $length);
197 197
         }
198 198
     
199 199
         return new static($this->repositories, $this->referencePrototype, $filtered);
Please login to merge, or discard this patch.
module/Core/src/Core/Repository/DoctrineMongoODM/CollectionFactory.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     protected $repositories;
29 29
     
30 30
     /**
31
-     * @param RepositoryService $repositories
31
+     * @param RepositoryService $repositoriesFactory
32 32
      */
33 33
     public function __construct(callable $repositoriesFactory)
34 34
     {
Please login to merge, or discard this patch.
module/Core/src/Core/Repository/DoctrineMongoODM/ConfigurationFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@
 block discarded – undo
65 65
         
66 66
         // custom collection factory
67 67
         $config->setPersistentCollectionNamespace('DoctrineMongoODMModule\Collection');
68
-        $config->setPersistentCollectionDir(__DIR__ . '/../../../../../../cache/DoctrineMongoODMModule/Collection');
69
-        $config->setPersistentCollectionFactory(new CollectionFactory(function () use ($serviceLocator)
68
+        $config->setPersistentCollectionDir(__DIR__.'/../../../../../../cache/DoctrineMongoODMModule/Collection');
69
+        $config->setPersistentCollectionFactory(new CollectionFactory(function() use ($serviceLocator)
70 70
         {
71 71
             return $serviceLocator->get('repositories');
72 72
         }));
Please login to merge, or discard this patch.