@@ -61,8 +61,7 @@ |
||
| 61 | 61 | if (array_key_exists('entityPath', $element['client'])) { |
| 62 | 62 | $pathSeparator = |
| 63 | 63 | array_key_exists('entityPathSeparator', $element['client']) ? |
| 64 | - $element['client']['entityPathSeparator'] : |
|
| 65 | - EntityMethodProvider::DEFAULT_PATH_SEPARATOR; |
|
| 64 | + $element['client']['entityPathSeparator'] : EntityMethodProvider::DEFAULT_PATH_SEPARATOR; |
|
| 66 | 65 | $methodProvider = |
| 67 | 66 | new EntityMethodProvider($element['client']['entityPath'], $pathSeparator, $methodProvider); |
| 68 | 67 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | ], |
| 188 | 188 | ] |
| 189 | 189 | ), |
| 190 | - function (RpcRequestInterface $request) { |
|
| 190 | + function(RpcRequestInterface $request) { |
|
| 191 | 191 | self::assertNull($request->getParameters()['criteria']['parent']); |
| 192 | 192 | |
| 193 | 193 | return true; |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | ], |
| 209 | 209 | ] |
| 210 | 210 | ), |
| 211 | - function (RpcRequestInterface $request) { |
|
| 211 | + function(RpcRequestInterface $request) { |
|
| 212 | 212 | self::assertNull($request->getParameters()['criteria']['payload']); |
| 213 | 213 | |
| 214 | 214 | return true; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | 'sub-payload' => 'sub-payload', |
| 233 | 233 | ] |
| 234 | 234 | ), |
| 235 | - function (RpcRequestInterface $request) { |
|
| 235 | + function(RpcRequestInterface $request) { |
|
| 236 | 236 | self::assertEquals('test-entity/find', $request->getMethod()); |
| 237 | 237 | self::assertEquals(['id' => 1], $request->getParameters()); |
| 238 | 238 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | ], |
| 257 | 257 | ] |
| 258 | 258 | ), |
| 259 | - function (RpcRequestInterface $request) { |
|
| 259 | + function(RpcRequestInterface $request) { |
|
| 260 | 260 | self::assertEquals('test-reference/search', $request->getMethod()); |
| 261 | 261 | self::assertEquals( |
| 262 | 262 | [ |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $this->getClient()->push( |
| 13 | 13 | $this->getResponseMock(true, 5), |
| 14 | - function (RpcRequestInterface $request) { |
|
| 14 | + function(RpcRequestInterface $request) { |
|
| 15 | 15 | self::assertEquals('prefixed-entity/count', $request->getMethod()); |
| 16 | 16 | self::assertEquals( |
| 17 | 17 | [ |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ], |
| 66 | 66 | ] |
| 67 | 67 | ), |
| 68 | - function (RpcRequestInterface $request) { |
|
| 68 | + function(RpcRequestInterface $request) { |
|
| 69 | 69 | self::assertEquals('discriminator/search', $request->getMethod()); |
| 70 | 70 | self::assertEquals( |
| 71 | 71 | [ |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | ], |
| 135 | 135 | ] |
| 136 | 136 | ), |
| 137 | - function (RpcRequestInterface $request) { |
|
| 137 | + function(RpcRequestInterface $request) { |
|
| 138 | 138 | self::assertEquals('discriminator/search', $request->getMethod()); |
| 139 | 139 | self::assertEquals( |
| 140 | 140 | [ |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | { |
| 178 | 178 | $this->getClient()->push( |
| 179 | 179 | $this->getResponseMock(true, ['id_field' => 241]), |
| 180 | - function (RpcRequestInterface $request) { |
|
| 180 | + function(RpcRequestInterface $request) { |
|
| 181 | 181 | self::assertEquals('discriminator/create', $request->getMethod()); |
| 182 | 182 | self::assertEquals( |
| 183 | 183 | [ |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | $this->getClient()->push( |
| 201 | 201 | $this->getResponseMock(true, ['id_field' => 241]), |
| 202 | - function (RpcRequestInterface $request) { |
|
| 202 | + function(RpcRequestInterface $request) { |
|
| 203 | 203 | self::assertEquals('discriminator/patch', $request->getMethod()); |
| 204 | 204 | self::assertEquals( |
| 205 | 205 | [ |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | $this->getClient('test-reference-client')->push( |
| 16 | 16 | $this->getResponseMock(true, 241), |
| 17 | - function (RpcRequestInterface $request) { |
|
| 17 | + function(RpcRequestInterface $request) { |
|
| 18 | 18 | self::assertEquals('test-reference/create', $request->getMethod()); |
| 19 | 19 | self::assertEquals( |
| 20 | 20 | [ |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $this->getClient('test-reference-client')->push( |
| 43 | 43 | $this->getResponseMock(true, ['id' => 241]), |
| 44 | - function (RpcRequestInterface $request) { |
|
| 44 | + function(RpcRequestInterface $request) { |
|
| 45 | 45 | self::assertEquals('test-reference/create', $request->getMethod()); |
| 46 | 46 | self::assertEquals( |
| 47 | 47 | [ |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $this->getClient()->push( |
| 72 | 72 | $this->getResponseMock(true, (object)['id' => 42]), |
| 73 | - function (RpcRequestInterface $request) { |
|
| 73 | + function(RpcRequestInterface $request) { |
|
| 74 | 74 | self::assertEquals('test-entity/create', $request->getMethod()); |
| 75 | 75 | self::assertEquals( |
| 76 | 76 | [ |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | $this->getClient('test-reference-client')->push( |
| 88 | 88 | $this->getResponseMock(true, (object)['id' => 241]), |
| 89 | - function (RpcRequestInterface $request) { |
|
| 89 | + function(RpcRequestInterface $request) { |
|
| 90 | 90 | self::assertEquals('test-reference/create', $request->getMethod()); |
| 91 | 91 | self::assertEquals( |
| 92 | 92 | [ |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $newParent = new TestEntity(); |
| 124 | 124 | $this->getClient()->push( |
| 125 | 125 | $this->getResponseMock(true, (object)['id' => 17]), |
| 126 | - function (RpcRequestInterface $request) { |
|
| 126 | + function(RpcRequestInterface $request) { |
|
| 127 | 127 | self::assertEquals('test-entity/create', $request->getMethod()); |
| 128 | 128 | self::assertEquals( |
| 129 | 129 | [ |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | ); |
| 139 | 139 | $this->getClient('test-reference-client')->push( |
| 140 | 140 | $this->getResponseMock(true, null), |
| 141 | - function (RpcRequestInterface $request) { |
|
| 141 | + function(RpcRequestInterface $request) { |
|
| 142 | 142 | self::assertEquals('test-reference/patch', $request->getMethod()); |
| 143 | 143 | self::assertEquals( |
| 144 | 144 | [ |
@@ -120,14 +120,14 @@ |
||
| 120 | 120 | $configuration->setClientRegistry($this->clientRegistry); |
| 121 | 121 | $configuration->setTypeRegistry(new BaseTypeRegistry(new TypeRegistry())); |
| 122 | 122 | $configuration->setFactoryRegistry($this->factoryRegistry); |
| 123 | - $configuration->setProxyDir(CACHE_DIR.'/doctrine/proxy/'); |
|
| 123 | + $configuration->setProxyDir(CACHE_DIR . '/doctrine/proxy/'); |
|
| 124 | 124 | $configuration->setProxyNamespace('Bankiru\Api\Doctrine\Test\Proxy'); |
| 125 | 125 | $driver = new MappingDriverChain(); |
| 126 | 126 | $driver->addDriver( |
| 127 | 127 | new YmlMetadataDriver( |
| 128 | 128 | new SymfonyFileLocator( |
| 129 | 129 | [ |
| 130 | - __DIR__.'/../Test/Resources/config/api/' => 'Bankiru\Api\Doctrine\Test\Entity', |
|
| 130 | + __DIR__ . '/../Test/Resources/config/api/' => 'Bankiru\Api\Doctrine\Test\Entity', |
|
| 131 | 131 | ], |
| 132 | 132 | '.api.yml', |
| 133 | 133 | DIRECTORY_SEPARATOR |
@@ -1740,7 +1740,7 @@ discard block |
||
| 1740 | 1740 | $class = $this->manager->getClassMetadata(get_class($entity)); |
| 1741 | 1741 | $associationMappings = array_filter( |
| 1742 | 1742 | $class->getAssociationMappings(), |
| 1743 | - function ($assoc) { |
|
| 1743 | + function($assoc) { |
|
| 1744 | 1744 | return $assoc['isCascadeRefresh']; |
| 1745 | 1745 | } |
| 1746 | 1746 | ); |
@@ -1779,7 +1779,7 @@ discard block |
||
| 1779 | 1779 | $class = $this->manager->getClassMetadata(get_class($entity)); |
| 1780 | 1780 | $associationMappings = array_filter( |
| 1781 | 1781 | $class->getAssociationMappings(), |
| 1782 | - function ($assoc) { |
|
| 1782 | + function($assoc) { |
|
| 1783 | 1783 | return $assoc['isCascadeDetach']; |
| 1784 | 1784 | } |
| 1785 | 1785 | ); |
@@ -1819,7 +1819,7 @@ discard block |
||
| 1819 | 1819 | $class = $this->manager->getClassMetadata(get_class($entity)); |
| 1820 | 1820 | $associationMappings = array_filter( |
| 1821 | 1821 | $class->getAssociationMappings(), |
| 1822 | - function ($assoc) { |
|
| 1822 | + function($assoc) { |
|
| 1823 | 1823 | return $assoc['isCascadeMerge']; |
| 1824 | 1824 | } |
| 1825 | 1825 | ); |
@@ -1857,11 +1857,11 @@ discard block |
||
| 1857 | 1857 | $class = $this->manager->getClassMetadata(get_class($entity)); |
| 1858 | 1858 | $associationMappings = array_filter( |
| 1859 | 1859 | $class->getAssociationMappings(), |
| 1860 | - function ($assoc) { |
|
| 1860 | + function($assoc) { |
|
| 1861 | 1861 | return $assoc['isCascadeRemove']; |
| 1862 | 1862 | } |
| 1863 | 1863 | ); |
| 1864 | - $entitiesToCascade = []; |
|
| 1864 | + $entitiesToCascade = []; |
|
| 1865 | 1865 | foreach ($associationMappings as $assoc) { |
| 1866 | 1866 | if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
| 1867 | 1867 | $entity->__load(); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | /** @var EntityMetadata $target */ |
| 45 | 45 | $target = $this->manager->getClassMetadata($mapping['target']); |
| 46 | 46 | |
| 47 | - $converter = function ($value) use ($target) { |
|
| 47 | + $converter = function($value) use ($target) { |
|
| 48 | 48 | if (!is_object($value)) { |
| 49 | 49 | return $value; |
| 50 | 50 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $values = $converter($values); |
| 71 | 71 | } |
| 72 | 72 | } else { |
| 73 | - $caster = function ($value) use ($field) { |
|
| 73 | + $caster = function($value) use ($field) { |
|
| 74 | 74 | $type = $this->manager |
| 75 | 75 | ->getConfiguration() |
| 76 | 76 | ->getTypeRegistry()->get($this->metadata->getTypeOfField($field)); |