@@ -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 | */ |
@@ -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; |
@@ -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 | * |
@@ -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 | }); |
@@ -123,8 +123,8 @@ |
||
| 123 | 123 | $targetIdName = array_shift($targetIdsNames); |
| 124 | 124 | $type = |
| 125 | 125 | $this->manager->getConfiguration() |
| 126 | - ->getTypeRegistry() |
|
| 127 | - ->get($targetMetadata->getTypeOfField($targetIdName)); |
|
| 126 | + ->getTypeRegistry() |
|
| 127 | + ->get($targetMetadata->getTypeOfField($targetIdName)); |
|
| 128 | 128 | $identifiers = [$targetIdName => $type->fromApiValue($value)]; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | $this->manager->getConfiguration() |
| 126 | 126 | ->getTypeRegistry() |
| 127 | 127 | ->get($targetMetadata->getTypeOfField($targetIdName)); |
| 128 | - $identifiers = [$targetIdName => $type->fromApiValue($value)]; |
|
| 128 | + $identifiers = [$targetIdName => $type->fromApiValue($value)]; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return $targetPersister->getToOneEntity($mapping, $entity, $identifiers); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | /** {@inheritdoc} */ |
| 14 | 14 | public function toApiValue($value, array $options = []) |
| 15 | 15 | { |
| 16 | - if (! $value instanceof \DateTime) { |
|
| 16 | + if (!$value instanceof \DateTime) { |
|
| 17 | 17 | $value = new \DateTime($value); |
| 18 | 18 | } |
| 19 | 19 | |
@@ -75,11 +75,11 @@ |
||
| 75 | 75 | if ($this->unitOfWork->isInIdentityMap($id[$field])) { |
| 76 | 76 | $associatedId = |
| 77 | 77 | $this->flattenIdentifier($targetClassMetadata, |
| 78 | - $this->unitOfWork->getEntityIdentifier($id[$field])); |
|
| 78 | + $this->unitOfWork->getEntityIdentifier($id[$field])); |
|
| 79 | 79 | } else { |
| 80 | 80 | $associatedId = |
| 81 | 81 | $this->flattenIdentifier($targetClassMetadata, |
| 82 | - $targetClassMetadata->getIdentifierValues($id[$field])); |
|
| 82 | + $targetClassMetadata->getIdentifierValues($id[$field])); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $flatId[$field] = implode(' ', $associatedId); |