@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param ApiMetadata $metadata |
86 | 86 | * @param array $identifiers |
87 | 87 | * |
88 | - * @return mixed |
|
88 | + * @return string |
|
89 | 89 | */ |
90 | 90 | private function getEntityKey(ApiMetadata $metadata, array $identifiers) |
91 | 91 | { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param ApiMetadata $metadata |
102 | 102 | * @param array $identifiers |
103 | 103 | * |
104 | - * @return bool |
|
104 | + * @return boolean|null |
|
105 | 105 | */ |
106 | 106 | public function set($data, ApiMetadata $metadata, array $identifiers) |
107 | 107 | { |
@@ -81,7 +81,7 @@ |
||
81 | 81 | /** |
82 | 82 | * Returns class cache configuration |
83 | 83 | * |
84 | - * @param $class |
|
84 | + * @param string $class |
|
85 | 85 | * |
86 | 86 | * @return array|null Null if cache is not enabled for this class (use implementation defaults) |
87 | 87 | */ |
@@ -80,6 +80,7 @@ |
||
80 | 80 | |
81 | 81 | /** |
82 | 82 | * @param array|mixed $id |
83 | + * @param string $className |
|
83 | 84 | * |
84 | 85 | * @return array |
85 | 86 | * @throws \LogicException |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * Finds all objects in the repository. |
59 | 59 | * |
60 | - * @return array The objects. |
|
60 | + * @return ApiCollection The objects. |
|
61 | 61 | */ |
62 | 62 | public function findAll() |
63 | 63 | { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @param int|null $limit |
77 | 77 | * @param int|null $offset |
78 | 78 | * |
79 | - * @return array The objects. |
|
79 | + * @return ApiCollection The objects. |
|
80 | 80 | * |
81 | 81 | * @throws \UnexpectedValueException |
82 | 82 | */ |
@@ -125,6 +125,9 @@ discard block |
||
125 | 125 | return $this->identifier; |
126 | 126 | } |
127 | 127 | |
128 | + /** |
|
129 | + * @param string[] $identifier |
|
130 | + */ |
|
128 | 131 | public function setIdentifier($identifier) |
129 | 132 | { |
130 | 133 | $this->identifier = $identifier; |
@@ -345,6 +348,9 @@ discard block |
||
345 | 348 | return $this->associations[$fieldName]; |
346 | 349 | } |
347 | 350 | |
351 | + /** |
|
352 | + * @param string $customRepositoryClassName |
|
353 | + */ |
|
348 | 354 | public function setCustomRepositoryClass($customRepositoryClassName) |
349 | 355 | { |
350 | 356 | $this->repositoryClass = $customRepositoryClassName; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @param int|null $limit |
99 | 99 | * @param int|null $offset |
100 | 100 | * |
101 | - * @return array |
|
101 | + * @return ArrayCollection |
|
102 | 102 | */ |
103 | 103 | public function loadAll(array $criteria = [], array $orderBy = null, $limit = null, $offset = null) |
104 | 104 | { |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @param object $sourceEntity |
252 | 252 | * @param AbstractLazyCollection $collection The collection to load/fill. |
253 | 253 | * |
254 | - * @return array |
|
254 | + * @return AbstractLazyCollection |
|
255 | 255 | */ |
256 | 256 | public function loadOneToManyCollection(array $assoc, $sourceEntity, AbstractLazyCollection $collection) |
257 | 257 | { |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * |
274 | 274 | * @param int|null $offset |
275 | 275 | * |
276 | - * @return array |
|
276 | + * @return ApiCollection |
|
277 | 277 | */ |
278 | 278 | public function getOneToManyCollection(array $assoc, $sourceEntity, $limit = null, $offset = null) |
279 | 279 | { |
@@ -175,10 +175,10 @@ |
||
175 | 175 | * @todo Check identity map? loadById method? Try to guess whether $criteria is the id? |
176 | 176 | */ |
177 | 177 | public function load(array $criteria, |
178 | - $entity = null, |
|
179 | - $assoc = null, |
|
180 | - $limit = null, |
|
181 | - array $orderBy = null) |
|
178 | + $entity = null, |
|
179 | + $assoc = null, |
|
180 | + $limit = null, |
|
181 | + array $orderBy = null) |
|
182 | 182 | { |
183 | 183 | // TODO: Implement load() method. |
184 | 184 | } |
@@ -115,7 +115,7 @@ |
||
115 | 115 | /** @var EntityMetadata $target */ |
116 | 116 | $target = $this->manager->getClassMetadata($mapping['target']); |
117 | 117 | |
118 | - $converter = function ($value) use ($target) { |
|
118 | + $converter = function($value) use ($target) { |
|
119 | 119 | if (!is_object($value)) { |
120 | 120 | return $value; |
121 | 121 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * @param $className |
|
88 | + * @param string $className |
|
89 | 89 | * |
90 | 90 | * @return EntityPersister |
91 | 91 | */ |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * @param $className |
|
145 | + * @param string $className |
|
146 | 146 | * @param \stdClass $data |
147 | 147 | * @param object|null $unmanagedProxy |
148 | 148 | * |
@@ -13,11 +13,8 @@ |
||
13 | 13 | use Bankiru\Api\Doctrine\Mapping\EntityMetadata; |
14 | 14 | use Bankiru\Api\Doctrine\Persister\ApiPersister; |
15 | 15 | use Bankiru\Api\Doctrine\Persister\EntityPersister; |
16 | -use Bankiru\Api\Doctrine\Proxy\ApiCollection; |
|
17 | 16 | use Bankiru\Api\Doctrine\Utility\IdentifierFlattener; |
18 | 17 | use Bankiru\Api\Doctrine\Utility\ReflectionPropertiesGetter; |
19 | -use Doctrine\Common\Collections\ArrayCollection; |
|
20 | -use Doctrine\Common\Collections\Collection; |
|
21 | 18 | use Doctrine\Common\NotifyPropertyChanged; |
22 | 19 | use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; |
23 | 20 | use Doctrine\Common\Persistence\ObjectManagerAware; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | private $mocks = []; |
36 | 36 | |
37 | 37 | /** |
38 | - * @return mixed |
|
38 | + * @return ClientRegistry |
|
39 | 39 | */ |
40 | 40 | public function getRegistry() |
41 | 41 | { |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use Bankiru\Api\Doctrine\EntityManager; |
15 | 15 | use Bankiru\Api\Doctrine\EntityMetadataFactory; |
16 | 16 | use Bankiru\Api\Doctrine\Mapping\Driver\YmlMetadataDriver; |
17 | -use Bankiru\Api\Doctrine\Proxy\ProxyFactory; |
|
18 | 17 | use Bankiru\Api\Doctrine\Type\BaseTypeRegistry; |
19 | 18 | use Bankiru\Api\Doctrine\Type\TypeRegistry; |
20 | 19 | use Bankiru\Api\Test\TestClient; |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | static $items = []; |
104 | 104 | $cache = $this->prophesize(CacheItemPoolInterface::class); |
105 | 105 | $that = $this; |
106 | - $cache->getItem(Argument::type('string'))->will(function ($args) use (&$items, $that) { |
|
106 | + $cache->getItem(Argument::type('string'))->will(function($args) use (&$items, $that) { |
|
107 | 107 | $key = $args[0]; |
108 | 108 | if (!array_key_exists($key, $items)) { |
109 | 109 | $item = $that->prophesize(CacheItemInterface::class); |
110 | 110 | $item->getKey()->willReturn($key); |
111 | 111 | $item->isHit()->willReturn(false); |
112 | 112 | $item->get()->willReturn(null); |
113 | - $item->set(Argument::any())->will(function ($args) use ($item) { |
|
113 | + $item->set(Argument::any())->will(function($args) use ($item) { |
|
114 | 114 | $item->get()->willReturn($args[0]); |
115 | 115 | }); |
116 | 116 | $item->expiresAfter(Argument::type('int'))->willReturn($item); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | return $items[$key]->reveal(); |
124 | 124 | }); |
125 | - $cache->save(Argument::type(CacheItemInterface::class))->will(function ($args) use (&$items) { |
|
125 | + $cache->save(Argument::type(CacheItemInterface::class))->will(function($args) use (&$items) { |
|
126 | 126 | $item = $args[0]; |
127 | 127 | $items[$item->getKey()]->isHit()->willReturn(true); |
128 | 128 | }); |