@@ -188,6 +188,9 @@ discard block |
||
| 188 | 188 | return $this->snapshot; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | + /** |
|
| 192 | + * @param boolean $state |
|
| 193 | + */ |
|
| 191 | 194 | public function setInitialized($state) |
| 192 | 195 | { |
| 193 | 196 | $this->initialized = (bool)$state; |
@@ -452,7 +455,7 @@ discard block |
||
| 452 | 455 | * Internal note: Tried to implement Serializable first but that did not work well |
| 453 | 456 | * with circular references. This solution seems simpler and works well. |
| 454 | 457 | * |
| 455 | - * @return array |
|
| 458 | + * @return string[] |
|
| 456 | 459 | */ |
| 457 | 460 | public function __sleep() |
| 458 | 461 | { |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | return array_udiff_assoc( |
| 205 | 205 | $this->snapshot, |
| 206 | 206 | $this->collection->toArray(), |
| 207 | - function ($a, $b) { |
|
| 207 | + function($a, $b) { |
|
| 208 | 208 | return $a === $b ? 0 : 1; |
| 209 | 209 | } |
| 210 | 210 | ); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | return array_udiff_assoc( |
| 222 | 222 | $this->collection->toArray(), |
| 223 | 223 | $this->snapshot, |
| 224 | - function ($a, $b) { |
|
| 224 | + function($a, $b) { |
|
| 225 | 225 | return $a === $b ? 0 : 1; |
| 226 | 226 | } |
| 227 | 227 | ); |
@@ -24,5 +24,5 @@ |
||
| 24 | 24 | * |
| 25 | 25 | * @return string |
| 26 | 26 | */ |
| 27 | - public function getEntityKey(ApiMetadata $metadata,array $identifier); |
|
| 27 | + public function getEntityKey(ApiMetadata $metadata, array $identifier); |
|
| 28 | 28 | } |
@@ -155,9 +155,9 @@ |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if ($property->isProtected()) { |
| 158 | - return "\0*\0".$propertyName; |
|
| 158 | + return "\0*\0" . $propertyName; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - return "\0".$property->getDeclaringClass()->getName()."\0".$propertyName; |
|
| 161 | + return "\0" . $property->getDeclaringClass()->getName() . "\0" . $propertyName; |
|
| 162 | 162 | } |
| 163 | 163 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * @param $className |
|
| 53 | + * @param string $className |
|
| 54 | 54 | * |
| 55 | 55 | * @return \ReflectionProperty[] indexed by property internal name |
| 56 | 56 | */ |
@@ -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 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | $repository = $this->getManager()->getRepository(CustomEntity::class); |
| 15 | 15 | $this->getClient()->push( |
| 16 | 16 | $this->getResponseMock(true, (object)['customField' => 'custom-response']), |
| 17 | - function (RpcRequestInterface $request) { |
|
| 17 | + function(RpcRequestInterface $request) { |
|
| 18 | 18 | self::assertEquals('custom-entity/custom', $request->getMethod()); |
| 19 | 19 | self::assertEquals( |
| 20 | 20 | ['param1' => 'value1'], |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | 'payload' => 'test', |
| 19 | 19 | ] |
| 20 | 20 | ), |
| 21 | - function (RpcRequestInterface $request) { |
|
| 21 | + function(RpcRequestInterface $request) { |
|
| 22 | 22 | self::assertEquals('indirect-entity/find', $request->getMethod()); |
| 23 | 23 | self::assertEquals(['some-long-api-field-name' => 241], $request->getParameters()); |
| 24 | 24 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | 'sub-payload' => 'sub-payload', |
| 22 | 22 | ] |
| 23 | 23 | ), |
| 24 | - function (RpcRequestInterface $request) { |
|
| 24 | + function(RpcRequestInterface $request) { |
|
| 25 | 25 | self::assertEquals('test-entity/find', $request->getMethod()); |
| 26 | 26 | self::assertEquals(['id' => 2], $request->getParameters()); |
| 27 | 27 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'sub-payload' => 'sub-payload', |
| 68 | 68 | ] |
| 69 | 69 | ), |
| 70 | - function (RpcRequestInterface $request) { |
|
| 70 | + function(RpcRequestInterface $request) { |
|
| 71 | 71 | self::assertEquals('test-entity/find', $request->getMethod()); |
| 72 | 72 | self::assertEquals(['id' => 2], $request->getParameters()); |
| 73 | 73 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | 'payload' => 'test-payload', |
| 22 | 22 | ] |
| 23 | 23 | ), |
| 24 | - function (RpcRequestInterface $request) { |
|
| 24 | + function(RpcRequestInterface $request) { |
|
| 25 | 25 | self::assertEquals('test-entity/find', $request->getMethod()); |
| 26 | 26 | self::assertEquals(['id' => 1], $request->getParameters()); |
| 27 | 27 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'sub-payload' => 'sub-payload', |
| 51 | 51 | ] |
| 52 | 52 | ), |
| 53 | - function (RpcRequestInterface $request) { |
|
| 53 | + function(RpcRequestInterface $request) { |
|
| 54 | 54 | self::assertEquals('test-entity/find', $request->getMethod()); |
| 55 | 55 | self::assertEquals(['id' => 2], $request->getParameters()); |
| 56 | 56 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | 'payload' => 'test-payload', |
| 80 | 80 | ] |
| 81 | 81 | ), |
| 82 | - function (RpcRequestInterface $request) { |
|
| 82 | + function(RpcRequestInterface $request) { |
|
| 83 | 83 | self::assertEquals('composite-key-entity/find', $request->getMethod()); |
| 84 | 84 | self::assertEquals(['first_key' => 2, 'second_key' => 'test'], $request->getParameters()); |
| 85 | 85 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | 'payload' => 'test-payload', |
| 24 | 24 | ] |
| 25 | 25 | ), |
| 26 | - function (RpcRequestInterface $request) { |
|
| 26 | + function(RpcRequestInterface $request) { |
|
| 27 | 27 | self::assertEquals('custom-entity/find', $request->getMethod()); |
| 28 | 28 | self::assertEquals(['id' => 1], $request->getParameters()); |
| 29 | 29 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $cache = $this->prophesize(CacheItemPoolInterface::class); |
| 99 | 99 | $that = $this; |
| 100 | 100 | $cache->getItem(Argument::type('string'))->will( |
| 101 | - function ($args) use (&$items, $that) { |
|
| 101 | + function($args) use (&$items, $that) { |
|
| 102 | 102 | $key = $args[0]; |
| 103 | 103 | if (!array_key_exists($key, $items)) { |
| 104 | 104 | $item = $that->prophesize(CacheItemInterface::class); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $item->isHit()->willReturn(false); |
| 107 | 107 | $item->get()->willReturn(null); |
| 108 | 108 | $item->set(Argument::any())->will( |
| 109 | - function ($args) use ($item) { |
|
| 109 | + function($args) use ($item) { |
|
| 110 | 110 | $item->get()->willReturn($args[0]); |
| 111 | 111 | |
| 112 | 112 | return $item; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | ); |
| 125 | 125 | $cache->save(Argument::type(CacheItemInterface::class))->will( |
| 126 | - function ($args) use (&$items) { |
|
| 126 | + function($args) use (&$items) { |
|
| 127 | 127 | $item = $args[0]; |
| 128 | 128 | $items[$item->getKey()]->isHit()->willReturn(true); |
| 129 | 129 | } |