@@ -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; |
@@ -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 | }); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | public function testLazyProxy() |
| 18 | 18 | { |
| 19 | - $manager = $this->getManager(); |
|
| 19 | + $manager = $this->getManager(); |
|
| 20 | 20 | |
| 21 | 21 | $this->getResponseMock()->append( |
| 22 | 22 | new Response( |
@@ -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 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $wakeupProxy = $classMetadata->getReflectionClass()->hasMethod('__wakeup'); |
| 91 | 91 | |
| 92 | - return function (Proxy $proxy) use ($classMetadata, $wakeupProxy, $persister) { |
|
| 92 | + return function(Proxy $proxy) use ($classMetadata, $wakeupProxy, $persister) { |
|
| 93 | 93 | $initializer = $proxy->__getInitializer(); |
| 94 | 94 | $cloner = $proxy->__getCloner(); |
| 95 | 95 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | private function createCloner(ApiMetadata $classMetadata, ApiPersister $persister) |
| 132 | 132 | { |
| 133 | - return function (Proxy $proxy) use ($classMetadata, $persister) { |
|
| 133 | + return function(Proxy $proxy) use ($classMetadata, $persister) { |
|
| 134 | 134 | if ($proxy->__isInitialized()) { |
| 135 | 135 | return; |
| 136 | 136 | } |
@@ -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 | } |
@@ -87,8 +87,7 @@ |
||
| 87 | 87 | if (array_key_exists('entityPath', $element['client'])) { |
| 88 | 88 | $pathSeparator = |
| 89 | 89 | array_key_exists('entityPathSeparator', $element['client']) ? |
| 90 | - $element['client']['entityPathSeparator'] : |
|
| 91 | - null; |
|
| 90 | + $element['client']['entityPathSeparator'] : null; |
|
| 92 | 91 | $methodProvider = new EntityMethodProvider($element['client']['entityPath'], $pathSeparator); |
| 93 | 92 | } |
| 94 | 93 | |