| @@ -191,9 +191,9 @@ | ||
| 191 | 191 | /** | 
| 192 | 192 | * getPropertyAnnotation | 
| 193 | 193 | * | 
| 194 | - * @param mixed $reader | |
| 195 | - * @param mixed $property | |
| 196 | - * @param mixed $classname | |
| 194 | + * @param FileCacheReader $reader | |
| 195 | + * @param \ReflectionProperty $property | |
| 196 | + * @param string $classname | |
| 197 | 197 | * @access private | 
| 198 | 198 | * @return void | 
| 199 | 199 | */ | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 | |
| 77 | 77 |          foreach ($iterator as $file) { | 
| 78 | 78 | $sourceFile = $file[0]; | 
| 79 | -            if (! preg_match('(^phar:)i', $sourceFile)) { | |
| 79 | +            if (!preg_match('(^phar:)i', $sourceFile)) { | |
| 80 | 80 | $sourceFile = realpath($sourceFile); | 
| 81 | 81 | } | 
| 82 | 82 | |
| @@ -114,7 +114,7 @@ discard block | ||
| 114 | 114 |      { | 
| 115 | 115 | $metadata = $this->getClassMetadataForClassname($classname); | 
| 116 | 116 | |
| 117 | - return $metadata ? [$metadata,] : []; | |
| 117 | + return $metadata ? [$metadata, ] : []; | |
| 118 | 118 | } | 
| 119 | 119 | |
| 120 | 120 | /** | 
| @@ -79,7 +79,7 @@ discard block | ||
| 79 | 79 | * @param array $data | 
| 80 | 80 | * @param string $modelName | 
| 81 | 81 | * @access public | 
| 82 | - * @return array | |
| 82 | + * @return HydraCollection | |
| 83 | 83 | */ | 
| 84 | 84 | public function hydrateList($data, $modelName) | 
| 85 | 85 |      { | 
| @@ -92,6 +92,9 @@ discard block | ||
| 92 | 92 | return new HydraCollection(); | 
| 93 | 93 | } | 
| 94 | 94 | |
| 95 | + /** | |
| 96 | + * @param string $modelName | |
| 97 | + */ | |
| 95 | 98 | public function deserializeAll($data, $modelName) | 
| 96 | 99 |      { | 
| 97 | 100 | $data['hydra:member'] = array_map( | 
| @@ -95,7 +95,7 @@ | ||
| 95 | 95 | public function deserializeAll($data, $modelName) | 
| 96 | 96 |      { | 
| 97 | 97 | $data['hydra:member'] = array_map( | 
| 98 | -            function ($member) use ($modelName) { | |
| 98 | +            function($member) use ($modelName) { | |
| 99 | 99 | return $this->deserialize($member, $modelName); | 
| 100 | 100 | }, | 
| 101 | 101 | $data['hydra:member'] | 
| @@ -202,7 +202,7 @@ | ||
| 202 | 202 | * getMappingArray | 
| 203 | 203 | * | 
| 204 | 204 | * @access private | 
| 205 | - * @return void | |
| 205 | + * @return ClassMetadata[] | |
| 206 | 206 | */ | 
| 207 | 207 | private function getMappingArray() | 
| 208 | 208 |      { | 
| @@ -24,7 +24,7 @@ discard block | ||
| 24 | 24 | ->given($this->newTestedInstance) | 
| 25 | 25 |                  ->and($this->testedInstance->setMapping([new ClassMetadata('foo', null, null)])) | 
| 26 | 26 | ->then($testedInstance = $this->testedInstance) | 
| 27 | -            ->exception(function () use ($testedInstance) { | |
| 27 | +            ->exception(function() use ($testedInstance) { | |
| 28 | 28 | @$testedInstance->getModelName(); | 
| 29 | 29 | }) | 
| 30 | 30 |                  ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException') | 
| @@ -34,7 +34,7 @@ discard block | ||
| 34 | 34 | ->given($this->newTestedInstance) | 
| 35 | 35 |                  ->and($this->testedInstance->setMapping([new ClassMetadata('foo', null, null)])) | 
| 36 | 36 | ->then($testedInstance = $this->testedInstance) | 
| 37 | -            ->exception(function () use ($testedInstance) { | |
| 37 | +            ->exception(function() use ($testedInstance) { | |
| 38 | 38 |                  $testedInstance->getModelName('orders'); | 
| 39 | 39 | }) | 
| 40 | 40 |                  ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException') | 
| @@ -44,7 +44,7 @@ discard block | ||
| 44 | 44 | ->given($this->newTestedInstance) | 
| 45 | 45 |              ->and($this->testedInstance->setMapping([new ClassMetadata('orders', null, null)])) | 
| 46 | 46 | ->then($testedInstance = $this->testedInstance) | 
| 47 | -            ->exception(function () use ($testedInstance) { | |
| 47 | +            ->exception(function() use ($testedInstance) { | |
| 48 | 48 |                  $testedInstance->getModelName('orders'); | 
| 49 | 49 | }) | 
| 50 | 50 |                  ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException') | 
| @@ -92,7 +92,7 @@ discard block | ||
| 92 | 92 | // no mappings | 
| 93 | 93 | ->given($this->newTestedInstance) | 
| 94 | 94 | ->then($testedInstance = $this->testedInstance) | 
| 95 | -                ->exception(function () use ($testedInstance) { | |
| 95 | +                ->exception(function() use ($testedInstance) { | |
| 96 | 96 |                      $testedInstance->getKeyFromId('/orders/8'); | 
| 97 | 97 | }) | 
| 98 | 98 |                  ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException') | 
| @@ -141,7 +141,7 @@ discard block | ||
| 141 | 141 |                      ->isEqualTo('order_items') | 
| 142 | 142 | |
| 143 | 143 | ->then($testedInstance = $this->testedInstance) | 
| 144 | -            ->exception(function () use ($testedInstance) { | |
| 144 | +            ->exception(function() use ($testedInstance) { | |
| 145 | 145 |                  $testedInstance->getKeyFromModel('\Not\Viable\Classname'); | 
| 146 | 146 | }) | 
| 147 | 147 |                  ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException') | 
| @@ -167,7 +167,7 @@ discard block | ||
| 167 | 167 |                      ->isInstanceOf('Mapado\RestClientSdk\Mapping\ClassMetadata') | 
| 168 | 168 | |
| 169 | 169 | ->then | 
| 170 | -            ->exception(function () use ($testedInstance) { | |
| 170 | +            ->exception(function() use ($testedInstance) { | |
| 171 | 171 |                  $testedInstance->getClassMetadata('Foo\Bar'); | 
| 172 | 172 | }) | 
| 173 | 173 |                      ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException') | 
| @@ -224,6 +224,6 @@ discard block | ||
| 224 | 224 | 'Foo\Bar\Client\ClientClient' | 
| 225 | 225 | ); | 
| 226 | 226 | |
| 227 | - return [ $order, $orderItem, $client, ]; | |
| 227 | + return [$order, $orderItem, $client, ]; | |
| 228 | 228 | } | 
| 229 | 229 | } | 
| @@ -154,7 +154,7 @@ | ||
| 154 | 154 | |
| 155 | 155 | public function addCartItemList($cartItem) | 
| 156 | 156 |      { | 
| 157 | - $this->cartItemList[] = $cartItem; | |
| 157 | + $this->cartItemList[] = $cartItem; | |
| 158 | 158 | } | 
| 159 | 159 | |
| 160 | 160 | /** | 
| @@ -60,7 +60,7 @@ discard block | ||
| 60 | 60 | ->isNull() | 
| 61 | 61 | |
| 62 | 62 | ->then($testedInstance = $this->testedInstance) | 
| 63 | -                ->exception(function () use ($testedInstance) { | |
| 63 | +                ->exception(function() use ($testedInstance) { | |
| 64 | 64 |                      $testedInstance->get('/error'); | 
| 65 | 65 | }) | 
| 66 | 66 |                      ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException') | 
| @@ -104,7 +104,7 @@ discard block | ||
| 104 | 104 | ->isNull() | 
| 105 | 105 | |
| 106 | 106 | ->then($testedInstance = $this->testedInstance) | 
| 107 | -                ->exception(function () use ($testedInstance) { | |
| 107 | +                ->exception(function() use ($testedInstance) { | |
| 108 | 108 |                      $testedInstance->delete('/error'); | 
| 109 | 109 | }) | 
| 110 | 110 |                      ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException') | 
| @@ -149,7 +149,7 @@ discard block | ||
| 149 | 149 | ->string($data['activityUuid']) | 
| 150 | 150 |                          ->isEqualTo('63d108be-629c-11e5-b5ce-f153631dac50') | 
| 151 | 151 | ->then($testedInstance = $this->testedInstance) | 
| 152 | -                ->exception(function () use ($testedInstance, $params) { | |
| 152 | +                ->exception(function() use ($testedInstance, $params) { | |
| 153 | 153 |                      $testedInstance->post('/not-found', $params); | 
| 154 | 154 | }) | 
| 155 | 155 |                      ->isInstanceOf('Mapado\RestClientSdk\Exception\RestClientException') | 
| @@ -157,7 +157,7 @@ discard block | ||
| 157 | 157 | ->hasCode(3) | 
| 158 | 158 | |
| 159 | 159 | ->then | 
| 160 | -                ->exception(function () use ($testedInstance, $params) { | |
| 160 | +                ->exception(function() use ($testedInstance, $params) { | |
| 161 | 161 |                      $testedInstance->post('/error', $params); | 
| 162 | 162 | }) | 
| 163 | 163 |                      ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException') | 
| @@ -202,7 +202,7 @@ discard block | ||
| 202 | 202 | ->string($data['activityUuid']) | 
| 203 | 203 |                          ->isEqualTo('a9e82f60-629e-11e5-8903-0d978bd11e5d') | 
| 204 | 204 | ->then($testedInstance = $this->testedInstance) | 
| 205 | -                ->exception(function () use ($testedInstance, $params) { | |
| 205 | +                ->exception(function() use ($testedInstance, $params) { | |
| 206 | 206 |                      $testedInstance->put('/not-found', $params); | 
| 207 | 207 | }) | 
| 208 | 208 |                      ->isInstanceOf('Mapado\RestClientSdk\Exception\RestClientException') | 
| @@ -210,7 +210,7 @@ discard block | ||
| 210 | 210 | ->hasCode(5) | 
| 211 | 211 | |
| 212 | 212 | ->then | 
| 213 | -                ->exception(function () use ($testedInstance, $params) { | |
| 213 | +                ->exception(function() use ($testedInstance, $params) { | |
| 214 | 214 |                      $testedInstance->put('/error', $params); | 
| 215 | 215 | }) | 
| 216 | 216 |                      ->isInstanceOf('Mapado\RestClientSdk\Exception\RestException') | 
| @@ -275,7 +275,7 @@ discard block | ||
| 275 | 275 | |
| 276 | 276 | ->if($testedInstance = $this->testedInstance) | 
| 277 | 277 | ->and | 
| 278 | -                ->exception(function () use ($testedInstance) { | |
| 278 | +                ->exception(function() use ($testedInstance) { | |
| 279 | 279 |                      $testedInstance->get('/'); | 
| 280 | 280 | }) | 
| 281 | 281 | ->then | 
| @@ -290,13 +290,13 @@ discard block | ||
| 290 | 290 | [ | 
| 291 | 291 | new Response( | 
| 292 | 292 | 200, | 
| 293 | - [ 'Content-Type' => 'application/ld+json' ], | |
| 293 | + ['Content-Type' => 'application/ld+json'], | |
| 294 | 294 | file_get_contents(__DIR__ . '/../data/ticketing.list.no_result.json') | 
| 295 | 295 | ), | 
| 296 | 296 | |
| 297 | 297 | new Response( | 
| 298 | 298 | 200, | 
| 299 | - [ 'Content-Type' => 'application/ld+json' ], | |
| 299 | + ['Content-Type' => 'application/ld+json'], | |
| 300 | 300 | file_get_contents(__DIR__ . '/../data/ticketing.list.no_result.json') | 
| 301 | 301 | ), | 
| 302 | 302 | ] | 
| @@ -60,7 +60,7 @@ | ||
| 60 | 60 |                  ->object($testedInstance->getRepository('orders')) | 
| 61 | 61 |                      ->isInstanceOf('Mapado\RestClientSdk\Tests\Model\ModelRepository') | 
| 62 | 62 | |
| 63 | -                ->exception(function () use ($testedInstance) { | |
| 63 | +                ->exception(function() use ($testedInstance) { | |
| 64 | 64 |                      $testedInstance->getRepository('foo'); | 
| 65 | 65 | }) | 
| 66 | 66 |                      ->isInstanceOf('Mapado\RestClientSdk\Exception\MappingException') | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 | public function __construct(ClientInterface $httpClient, $baseUrl = null) | 
| 54 | 54 |      { | 
| 55 | 55 | $this->httpClient = $httpClient; | 
| 56 | - $this->baseUrl = substr($baseUrl, -1) === '/' ? substr($baseUrl, 0, -1) : $baseUrl; | |
| 56 | + $this->baseUrl = substr($baseUrl, -1) === '/' ? substr($baseUrl, 0, -1) : $baseUrl; | |
| 57 | 57 | |
| 58 | 58 | $this->logHistory = false; | 
| 59 | 59 | $this->requestHistory = []; | 
| @@ -188,7 +188,7 @@ discard block | ||
| 188 | 188 | $headers = $response->getHeaders(); | 
| 189 | 189 | $jsonContentTypeList = ['application/ld+json', 'application/json']; | 
| 190 | 190 | |
| 191 | - $requestIsJson = false; | |
| 191 | + $requestIsJson = false; | |
| 192 | 192 | |
| 193 | 193 |          if (isset($headers['Content-Type'])) { | 
| 194 | 194 |              foreach ($jsonContentTypeList as $contentType) { | 
| @@ -208,9 +208,9 @@ | ||
| 208 | 208 | /** | 
| 209 | 209 | * logRequest | 
| 210 | 210 | * | 
| 211 | - * @param mixed $startTime | |
| 212 | - * @param mixed $method | |
| 213 | - * @param mixed $url | |
| 211 | + * @param double|null $startTime | |
| 212 | + * @param string $method | |
| 213 | + * @param string $url | |
| 214 | 214 | * @param mixed $parameters | 
| 215 | 215 | * @param mixed $response | 
| 216 | 216 | * @access private | 
| @@ -76,7 +76,7 @@ | ||
| 76 | 76 | public function getMappingKeys() | 
| 77 | 77 |      { | 
| 78 | 78 | return array_map( | 
| 79 | -            function ($mapping) { | |
| 79 | +            function($mapping) { | |
| 80 | 80 | return $mapping->getKey(); | 
| 81 | 81 | }, | 
| 82 | 82 | $this->mapping | 
| @@ -125,8 +125,8 @@ discard block | ||
| 125 | 125 | $sdk = $this; | 
| 126 | 126 | |
| 127 | 127 | $factory = new LazyLoadingGhostFactory(); | 
| 128 | - $initializer = function ( | |
| 129 | - LazyLoadingInterface &$proxy, | |
| 128 | + $initializer = function( | |
| 129 | + LazyLoadingInterface&$proxy, | |
| 130 | 130 | $method, | 
| 131 | 131 | array $parameters, | 
| 132 | 132 | & $initializer | 
| @@ -136,7 +136,7 @@ discard block | ||
| 136 | 136 | $id | 
| 137 | 137 |          ) { | 
| 138 | 138 |              if ($method !== 'getId' && $method !== 'setId' && $method !== 'jsonSerialize') { | 
| 139 | - $initializer = null; // disable initialization | |
| 139 | + $initializer = null; // disable initialization | |
| 140 | 140 | |
| 141 | 141 | // load data and modify the object here | 
| 142 | 142 |                  if ($id) { | 
| @@ -50,7 +50,7 @@ discard block | ||
| 50 | 50 | |
| 51 | 51 | /** | 
| 52 | 52 | * Constructor | 
| 53 | - * @param ClientInterface $restClient | |
| 53 | + * @param RestClient $restClient | |
| 54 | 54 | */ | 
| 55 | 55 | public function __construct(RestClient $restClient, Mapping $mapping, Serializer $serializer = null) | 
| 56 | 56 |      { | 
| @@ -70,7 +70,7 @@ discard block | ||
| 70 | 70 | * | 
| 71 | 71 | * @param CacheItemPoolInterface $cacheItemPool | 
| 72 | 72 | * @access public | 
| 73 | - * @return EntityRepository | |
| 73 | + * @return SdkClient | |
| 74 | 74 | */ | 
| 75 | 75 | public function setCacheItemPool(CacheItemPoolInterface $cacheItemPool, $cachePrefix = '') | 
| 76 | 76 |      { | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | * getCacheItemPool | 
| 85 | 85 | * | 
| 86 | 86 | * @access public | 
| 87 | - * @return CacheItemPool | |
| 87 | + * @return CacheItemPoolInterface | |
| 88 | 88 | */ | 
| 89 | 89 | public function getCacheItemPool() | 
| 90 | 90 |      { | 
| @@ -176,7 +176,7 @@ discard block | ||
| 176 | 176 | * | 
| 177 | 177 | * @param string $id | 
| 178 | 178 | * @access public | 
| 179 | - * @return object | |
| 179 | + * @return \ProxyManager\Proxy\GhostObjectInterface | |
| 180 | 180 | */ | 
| 181 | 181 | public function createProxy($id) | 
| 182 | 182 |      { |