@@ -48,6 +48,7 @@ |
||
| 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 | { |
@@ -51,7 +51,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -28,7 +28,7 @@ |
||
| 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 | { |
@@ -65,8 +65,8 @@ |
||
| 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 | })); |