@@ -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 | ); |
@@ -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( |
@@ -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; |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | public function getMediaType(): string |
| 100 | 100 | { |
| 101 | 101 | if ($this->mediaType === null) { |
| 102 | - $this->mediaType = $this->type . '/' . $this->getSubType(); |
|
| 102 | + $this->mediaType = $this->type.'/'.$this->getSubType(); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | return $this->mediaType; |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | if (empty($attributes) === false) { |
| 269 | 269 | \assert( |
| 270 | 270 | \json_encode($attributes) !== false, |
| 271 | - 'Attributes for resource type `' . $resource->getType() . |
|
| 271 | + 'Attributes for resource type `'.$resource->getType(). |
|
| 272 | 272 | '` cannot be converted into JSON. Please check its Schema returns valid data.' |
| 273 | 273 | ); |
| 274 | 274 | $representation[DocumentInterface::KEYWORD_ATTRIBUTES] = $attributes; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | if (empty($relationships) === false) { |
| 279 | 279 | \assert( |
| 280 | 280 | \json_encode($relationships) !== false, |
| 281 | - 'Relationships for resource type `' . $resource->getType() . |
|
| 281 | + 'Relationships for resource type `'.$resource->getType(). |
|
| 282 | 282 | '` cannot be converted into JSON. Please check its Schema returns valid data.' |
| 283 | 283 | ); |
| 284 | 284 | $representation[DocumentInterface::KEYWORD_RELATIONSHIPS] = $relationships; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $links = $this->getLinksRepresentation($this->getUrlPrefix(), $resource->getLinks()); |
| 289 | 289 | \assert( |
| 290 | 290 | \json_encode($links) !== false, |
| 291 | - 'Links for resource type `' . $resource->getType() . |
|
| 291 | + 'Links for resource type `'.$resource->getType(). |
|
| 292 | 292 | '` cannot be converted into JSON. Please check its Schema returns valid data.' |
| 293 | 293 | ); |
| 294 | 294 | $representation[DocumentInterface::KEYWORD_LINKS] = $links; |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | $meta = $resource->getResourceMeta(); |
| 299 | 299 | \assert( |
| 300 | 300 | \json_encode($meta) !== false, |
| 301 | - 'Meta for resource type `' . $resource->getType() . |
|
| 301 | + 'Meta for resource type `'.$resource->getType(). |
|
| 302 | 302 | '` cannot be converted into JSON. Please check its Schema returns valid data.' |
| 303 | 303 | ); |
| 304 | 304 | $representation[DocumentInterface::KEYWORD_META] = $meta; |