@@ -230,7 +230,7 @@ |
||
| 230 | 230 | * @param Frame $current |
| 231 | 231 | * @param Frame|null $previous |
| 232 | 232 | * |
| 233 | - * @return bool[] |
|
| 233 | + * @return boolean[] |
|
| 234 | 234 | */ |
| 235 | 235 | private function getIfTargets($rootType, Frame $current, Frame $previous = null) |
| 236 | 236 | { |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $foundInData = isset($this->bufferForData[$type][$idx]); |
| 265 | 265 | $foundInIncluded = isset($this->bufferForIncluded[$type][$idx]); |
| 266 | 266 | |
| 267 | - $addMeta = function (array $representation, Closure $getMetaClosure) { |
|
| 267 | + $addMeta = function(array $representation, Closure $getMetaClosure) { |
|
| 268 | 268 | if (empty($representation[self::KEYWORD_RELATIONSHIPS]) === true) { |
| 269 | 269 | // if no relationships have been added remove empty placeholder |
| 270 | 270 | unset($representation[self::KEYWORD_RELATIONSHIPS]); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $representation = $this->bufferForData[$type][$idx]; |
| 284 | 284 | unset($this->bufferForData[$type][$idx]); |
| 285 | 285 | |
| 286 | - $this->data[] = $addMeta($representation, function () use ($resource) { |
|
| 286 | + $this->data[] = $addMeta($representation, function() use ($resource) { |
|
| 287 | 287 | return $resource->getRelationshipsPrimaryMeta(); |
| 288 | 288 | }); |
| 289 | 289 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $representation = $this->bufferForIncluded[$type][$idx]; |
| 293 | 293 | unset($this->bufferForIncluded[$type][$idx]); |
| 294 | 294 | |
| 295 | - $this->included[] = $addMeta($representation, function () use ($resource) { |
|
| 295 | + $this->included[] = $addMeta($representation, function() use ($resource) { |
|
| 296 | 296 | return $resource->getRelationshipsInclusionMeta(); |
| 297 | 297 | }); |
| 298 | 298 | // remember we added (type, id) at index |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | self::KEYWORD_LINKS => $this->links, |
| 317 | 317 | self::KEYWORD_DATA => true, // this field wont be filtered |
| 318 | 318 | self::KEYWORD_INCLUDED => empty($this->included) === true ? null : array_values($this->included), |
| 319 | - ], function ($value) { |
|
| 319 | + ], function($value) { |
|
| 320 | 320 | return $value !== null; |
| 321 | 321 | }); |
| 322 | 322 | |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | self::KEYWORD_ERRORS_DETAIL => $error->getDetail(), |
| 365 | 365 | self::KEYWORD_ERRORS_SOURCE => $error->getSource(), |
| 366 | 366 | self::KEYWORD_ERRORS_META => $error->getMeta(), |
| 367 | - ], function ($value) { |
|
| 367 | + ], function($value) { |
|
| 368 | 368 | return $value !== null; |
| 369 | 369 | }); |
| 370 | 370 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | private function getLinkRepresentation($prefix = null, LinkInterface $link = null) |
| 236 | 236 | { |
| 237 | 237 | return $link === null ? null : $this->getUrlRepresentation( |
| 238 | - $link->isTreatAsHref() === true ? $link->getSubHref() : $prefix . $link->getSubHref(), |
|
| 238 | + $link->isTreatAsHref() === true ? $link->getSubHref() : $prefix.$link->getSubHref(), |
|
| 239 | 239 | $link->getMeta() |
| 240 | 240 | ); |
| 241 | 241 | } |
@@ -262,8 +262,7 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | $baseUrl = null; |
| 264 | 264 | if (($selfSubLink = $parent->getSelfSubLink()) !== null) { |
| 265 | - $baseUrl = $selfSubLink->isTreatAsHref() === true ? $selfSubLink->getSubHref() . '/' : |
|
| 266 | - $this->document->getUrlPrefix() . $selfSubLink->getSubHref() . '/'; |
|
| 265 | + $baseUrl = $selfSubLink->isTreatAsHref() === true ? $selfSubLink->getSubHref().'/' : $this->document->getUrlPrefix().$selfSubLink->getSubHref().'/'; |
|
| 267 | 266 | } |
| 268 | 267 | |
| 269 | 268 | foreach ($relation->getLinks() as $name => $link) { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | return $this->getRelationshipLink( |
| 127 | 127 | $resource, |
| 128 | 128 | DocumentInterface::KEYWORD_SELF, |
| 129 | - '/' . DocumentInterface::KEYWORD_RELATIONSHIPS, |
|
| 129 | + '/'.DocumentInterface::KEYWORD_RELATIONSHIPS, |
|
| 130 | 130 | $relationshipName, |
| 131 | 131 | $meta, |
| 132 | 132 | $treatAsHref |
@@ -262,8 +262,7 @@ discard block |
||
| 262 | 262 | protected function encodeToJson(array $document) |
| 263 | 263 | { |
| 264 | 264 | return $this->encoderOptions === null ? |
| 265 | - json_encode($document) : |
|
| 266 | - json_encode($document, $this->encoderOptions->getOptions(), $this->encoderOptions->getDepth()); |
|
| 265 | + json_encode($document) : json_encode($document, $this->encoderOptions->getOptions(), $this->encoderOptions->getDepth()); |
|
| 267 | 266 | } |
| 268 | 267 | |
| 269 | 268 | /** |
@@ -351,7 +350,7 @@ discard block |
||
| 351 | 350 | { |
| 352 | 351 | $parentSubLink = $this->container->getSchema($resource)->getSelfSubLink($resource); |
| 353 | 352 | |
| 354 | - $selfHref = $parentSubLink->getSubHref() . $prefix .'/'. $name; |
|
| 353 | + $selfHref = $parentSubLink->getSubHref().$prefix.'/'.$name; |
|
| 355 | 354 | $links = [ |
| 356 | 355 | $key => $this->factory->createLink($selfHref, $meta, $treatAsHref), |
| 357 | 356 | ]; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | foreach ($includePaths as $curPath) { |
| 107 | 107 | if ($pathLength === 0) { |
| 108 | 108 | $relationshipName = $this->getRelationshipNameForTopResource($curPath); |
| 109 | - } elseif (strpos($curPath, $pathBeginning . DocumentInterface::PATH_SEPARATOR) === 0) { |
|
| 109 | + } elseif (strpos($curPath, $pathBeginning.DocumentInterface::PATH_SEPARATOR) === 0) { |
|
| 110 | 110 | $relationshipName = $this->getRelationshipNameForResource($curPath, $pathLength); |
| 111 | 111 | } else { |
| 112 | 112 | $relationshipName = null; |
@@ -205,8 +205,7 @@ discard block |
||
| 205 | 205 | { |
| 206 | 206 | $nextSeparatorPos = strpos($curPath, DocumentInterface::PATH_SEPARATOR, $pathLength + 1); |
| 207 | 207 | $relationshipName = $nextSeparatorPos === false ? |
| 208 | - substr($curPath, $pathLength + 1) : |
|
| 209 | - substr($curPath, $pathLength + 1, $nextSeparatorPos - $pathLength - 1); |
|
| 208 | + substr($curPath, $pathLength + 1) : substr($curPath, $pathLength + 1, $nextSeparatorPos - $pathLength - 1); |
|
| 210 | 209 | |
| 211 | 210 | return $relationshipName; |
| 212 | 211 | } |
@@ -243,8 +243,7 @@ |
||
| 243 | 243 | { |
| 244 | 244 | ($data === null || (is_array($data) === true && empty($data) === true)) ?: Exceptions::throwLogicException(); |
| 245 | 245 | |
| 246 | - $replyType = ($data === null ? ParserReplyInterface::REPLY_TYPE_NULL_RESOURCE_STARTED : |
|
| 247 | - ParserReplyInterface::REPLY_TYPE_EMPTY_RESOURCE_STARTED); |
|
| 246 | + $replyType = ($data === null ? ParserReplyInterface::REPLY_TYPE_NULL_RESOURCE_STARTED : ParserReplyInterface::REPLY_TYPE_EMPTY_RESOURCE_STARTED); |
|
| 248 | 247 | |
| 249 | 248 | return $this->parserFactory->createEmptyReply($replyType, $this->stack); |
| 250 | 249 | } |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | $this->path = $this->relationship->getName(); |
| 130 | 130 | } else { |
| 131 | 131 | $this->path = |
| 132 | - $this->previous->getPath() . DocumentInterface::PATH_SEPARATOR . $this->relationship->getName(); |
|
| 132 | + $this->previous->getPath().DocumentInterface::PATH_SEPARATOR.$this->relationship->getName(); |
|
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | if ($this->selfSubUrl === null) { |
| 88 | - $this->selfSubUrl = '/' . $this->resourceType . '/'; |
|
| 88 | + $this->selfSubUrl = '/'.$this->resourceType.'/'; |
|
| 89 | 89 | } else { |
| 90 | 90 | $isOk = |
| 91 | 91 | is_string($this->selfSubUrl) === true && |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function getSelfSubLink($resource) |
| 126 | 126 | { |
| 127 | - return new Link($this->selfSubUrl . $this->getId($resource)); |
|
| 127 | + return new Link($this->selfSubUrl.$this->getId($resource)); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | $links = $this->getValue($description, self::LINKS, []); |
| 251 | 251 | if ($isShowSelf === true && isset($links[LinkInterface::SELF]) === false) { |
| 252 | 252 | $links[LinkInterface::SELF] = $this->factory->createLink( |
| 253 | - DocumentInterface::KEYWORD_RELATIONSHIPS. '/'.$relationshipName |
|
| 253 | + DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName |
|
| 254 | 254 | ); |
| 255 | 255 | } |
| 256 | 256 | if ($isShowRelated === true && isset($links[LinkInterface::RELATED]) === false) { |
@@ -44,7 +44,8 @@ |
||
| 44 | 44 | /** |
| 45 | 45 | * @inheritdoc |
| 46 | 46 | * |
| 47 | - * @return AcceptHeaderInterface |
|
| 47 | + * @param string[] $header |
|
| 48 | + * @return Header |
|
| 48 | 49 | */ |
| 49 | 50 | public static function parse($header, $accept = self::HEADER_ACCEPT) |
| 50 | 51 | { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function __construct($unsortedMediaTypes) |
| 33 | 33 | { |
| 34 | 34 | |
| 35 | - if (is_array($unsortedMediaTypes) === false) { |
|
| 35 | + if (is_array($unsortedMediaTypes) === false) { |
|
| 36 | 36 | throw new InvalidArgumentException('unsortedMediaTypes'); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | private function getMediaTypeCompareClosure() |
| 79 | 79 | { |
| 80 | - return function (AcceptMediaTypeInterface $lhs, AcceptMediaTypeInterface $rhs) { |
|
| 80 | + return function(AcceptMediaTypeInterface $lhs, AcceptMediaTypeInterface $rhs) { |
|
| 81 | 81 | $qualityCompare = $this->compareQuality($lhs->getQuality(), $rhs->getQuality()); |
| 82 | 82 | if ($qualityCompare !== 0) { |
| 83 | 83 | return $qualityCompare; |