@@ -87,7 +87,7 @@ |
||
| 87 | 87 | */ |
| 88 | 88 | public static function getCompare(): Closure |
| 89 | 89 | { |
| 90 | - return function (AcceptMediaTypeInterface $lhs, AcceptMediaTypeInterface $rhs) { |
|
| 90 | + return function(AcceptMediaTypeInterface $lhs, AcceptMediaTypeInterface $rhs) { |
|
| 91 | 91 | $qualityCompare = self::compareQuality($lhs->getQuality(), $rhs->getQuality()); |
| 92 | 92 | if ($qualityCompare !== 0) { |
| 93 | 93 | return $qualityCompare; |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | */ |
| 567 | 567 | protected function getPathToData(): string |
| 568 | 568 | { |
| 569 | - return '/' . DocumentInterface::KEYWORD_DATA; |
|
| 569 | + return '/'.DocumentInterface::KEYWORD_DATA; |
|
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | /** |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | */ |
| 575 | 575 | protected function getPathToType(): string |
| 576 | 576 | { |
| 577 | - return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_TYPE; |
|
| 577 | + return $this->getPathToData().'/'.DocumentInterface::KEYWORD_TYPE; |
|
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | /** |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | */ |
| 583 | 583 | protected function getPathToId(): string |
| 584 | 584 | { |
| 585 | - return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_ID; |
|
| 585 | + return $this->getPathToData().'/'.DocumentInterface::KEYWORD_ID; |
|
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | /** |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | */ |
| 591 | 591 | protected function getPathToAttributes(): string |
| 592 | 592 | { |
| 593 | - return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_ATTRIBUTES; |
|
| 593 | + return $this->getPathToData().'/'.DocumentInterface::KEYWORD_ATTRIBUTES; |
|
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | /** |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | */ |
| 601 | 601 | protected function getPathToAttribute(string $name): string |
| 602 | 602 | { |
| 603 | - return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_ATTRIBUTES . '/' . $name; |
|
| 603 | + return $this->getPathToData().'/'.DocumentInterface::KEYWORD_ATTRIBUTES.'/'.$name; |
|
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | /** |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | */ |
| 609 | 609 | protected function getPathToRelationships(): string |
| 610 | 610 | { |
| 611 | - return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_RELATIONSHIPS; |
|
| 611 | + return $this->getPathToData().'/'.DocumentInterface::KEYWORD_RELATIONSHIPS; |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | /** |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | */ |
| 619 | 619 | protected function getPathToRelationship(string $name): string |
| 620 | 620 | { |
| 621 | - return $this->getPathToRelationships() . '/' . $name; |
|
| 621 | + return $this->getPathToRelationships().'/'.$name; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
@@ -628,8 +628,8 @@ discard block |
||
| 628 | 628 | */ |
| 629 | 629 | protected function getPathToRelationshipType(string $name): string |
| 630 | 630 | { |
| 631 | - return $this->getPathToRelationship($name) . '/' . |
|
| 632 | - DocumentInterface::KEYWORD_DATA . '/' . DocumentInterface::KEYWORD_TYPE; |
|
| 631 | + return $this->getPathToRelationship($name).'/'. |
|
| 632 | + DocumentInterface::KEYWORD_DATA.'/'.DocumentInterface::KEYWORD_TYPE; |
|
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | /** |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | */ |
| 640 | 640 | protected function getPathToRelationshipId(string $name): string |
| 641 | 641 | { |
| 642 | - return $this->getPathToRelationship($name) . '/' . |
|
| 643 | - DocumentInterface::KEYWORD_DATA . '/' . DocumentInterface::KEYWORD_ID; |
|
| 642 | + return $this->getPathToRelationship($name).'/'. |
|
| 643 | + DocumentInterface::KEYWORD_DATA.'/'.DocumentInterface::KEYWORD_ID; |
|
| 644 | 644 | } |
| 645 | 645 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | $nextPosition = $factory->createPosition( |
| 70 | 70 | $nextLevel, |
| 71 | - $nextPathPrefix . $name, |
|
| 71 | + $nextPathPrefix.$name, |
|
| 72 | 72 | $parentType, |
| 73 | 73 | $name |
| 74 | 74 | ); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | /** @var string */ |
| 51 | 51 | public const MSG_CAN_NOT_PARSE_RELATIONSHIP = |
| 52 | - 'For resource of type `%s` with ID `%s` relationship `%s` cannot be parsed because it either ' . |
|
| 52 | + 'For resource of type `%s` with ID `%s` relationship `%s` cannot be parsed because it either '. |
|
| 53 | 53 | 'has `null` or identifier as data. Skipping.'; |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | foreach ($paths as $path) { |
| 500 | 500 | $curPath = ''; |
| 501 | 501 | foreach (\explode($separator, $path) as $pathPart) { |
| 502 | - $curPath = empty($curPath) === true ? $pathPart : $curPath . $separator . $pathPart; |
|
| 502 | + $curPath = empty($curPath) === true ? $pathPart : $curPath.$separator.$pathPart; |
|
| 503 | 503 | $normalizedPaths[$curPath] = true; |
| 504 | 504 | } |
| 505 | 505 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | { |
| 71 | 71 | \assert( |
| 72 | 72 | $this->schemaContainer->hasSchema($resource), |
| 73 | - 'No Schema found for resource `' . \get_class($resource) . '`.' |
|
| 73 | + 'No Schema found for resource `'.\get_class($resource).'`.' |
|
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | return $this->factory->createParsedResource( |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | \assert( |
| 205 | 205 | \call_user_func( |
| 206 | - function (array $paths): bool { |
|
| 206 | + function(array $paths): bool { |
|
| 207 | 207 | $pathsOk = true; |
| 208 | 208 | foreach ($paths as $path) { |
| 209 | 209 | $pathsOk = $pathsOk === true && \is_string($path) === true && empty($path) === false; |
@@ -299,8 +299,7 @@ discard block |
||
| 299 | 299 | public function withLinks(iterable $links): EncoderInterface |
| 300 | 300 | { |
| 301 | 301 | $this->links = $this->hasLinks() === false ? |
| 302 | - $links : |
|
| 303 | - $this->links = \array_merge( |
|
| 302 | + $links : $this->links = \array_merge( |
|
| 304 | 303 | $this->iterableToArray($this->getLinks()), |
| 305 | 304 | $this->iterableToArray($links) |
| 306 | 305 | ); |
@@ -106,6 +106,6 @@ |
||
| 106 | 106 | */ |
| 107 | 107 | protected function buildUrl(string $prefix): string |
| 108 | 108 | { |
| 109 | - return $this->isSubUrl ? $prefix . $this->value : $this->value; |
|
| 109 | + return $this->isSubUrl ? $prefix.$this->value : $this->value; |
|
| 110 | 110 | } |
| 111 | 111 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | // Feel free to override this method to change default URL or add meta |
| 76 | 76 | |
| 77 | - $url = $this->getSelfSubUrl($resource) . '/' . DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $name; |
|
| 77 | + $url = $this->getSelfSubUrl($resource).'/'.DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$name; |
|
| 78 | 78 | |
| 79 | 79 | return $this->factory->createLink(true, $url, false); |
| 80 | 80 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | // Feel free to override this method to change default URL or add meta |
| 88 | 88 | |
| 89 | - $url = $this->getSelfSubUrl($resource) . '/' . $name; |
|
| 89 | + $url = $this->getSelfSubUrl($resource).'/'.$name; |
|
| 90 | 90 | |
| 91 | 91 | return $this->factory->createLink(true, $url, false); |
| 92 | 92 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | protected function getResourcesSubUrl(): string |
| 158 | 158 | { |
| 159 | 159 | if ($this->subUrl === null) { |
| 160 | - $this->subUrl = '/' . $this->getType(); |
|
| 160 | + $this->subUrl = '/'.$this->getType(); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | return $this->subUrl; |
@@ -170,6 +170,6 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | protected function getSelfSubUrl($resource): string |
| 172 | 172 | { |
| 173 | - return $this->getResourcesSubUrl() . '/' . $this->getId($resource); |
|
| 173 | + return $this->getResourcesSubUrl().'/'.$this->getId($resource); |
|
| 174 | 174 | } |
| 175 | 175 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | $currentPath = $this->position->getPath(); |
| 176 | 176 | $nextLevel = $this->position->getLevel() + 1; |
| 177 | - $nextPathPrefix = empty($currentPath) === true ? '' : $currentPath . PositionInterface::PATH_SEPARATOR; |
|
| 177 | + $nextPathPrefix = empty($currentPath) === true ? '' : $currentPath.PositionInterface::PATH_SEPARATOR; |
|
| 178 | 178 | foreach ($this->schema->getRelationships($this->data) as $name => $description) { |
| 179 | 179 | \assert($this->assertRelationshipNameAndDescription($name, $description) === true); |
| 180 | 180 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | \assert( |
| 198 | 198 | $hasData || $hasMeta || $hasLinks, |
| 199 | - "Relationship `$name` for type `" . $this->getType() . |
|
| 199 | + "Relationship `$name` for type `".$this->getType(). |
|
| 200 | 200 | '` MUST contain at least one of the following: links, data or meta.' |
| 201 | 201 | ); |
| 202 | 202 | |
@@ -277,11 +277,11 @@ discard block |
||
| 277 | 277 | { |
| 278 | 278 | \assert( |
| 279 | 279 | \is_string($name) === true && empty($name) === false, |
| 280 | - "Relationship names for type `" . $this->getType() . '` should be non-empty strings.' |
|
| 280 | + "Relationship names for type `".$this->getType().'` should be non-empty strings.' |
|
| 281 | 281 | ); |
| 282 | 282 | \assert( |
| 283 | 283 | \is_array($description) === true && empty($description) === false, |
| 284 | - "Relationship `$name` for type `" . $this->getType() . '` should be a non-empty array.' |
|
| 284 | + "Relationship `$name` for type `".$this->getType().'` should be a non-empty array.' |
|
| 285 | 285 | ); |
| 286 | 286 | |
| 287 | 287 | return true; |