@@ -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; |
@@ -97,7 +97,7 @@ |
||
97 | 97 | public function getMediaType(): string |
98 | 98 | { |
99 | 99 | if ($this->mediaType === null) { |
100 | - $this->mediaType = $this->getType() . '/' . $this->getSubType(); |
|
100 | + $this->mediaType = $this->getType().'/'.$this->getSubType(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | return $this->mediaType; |
@@ -138,6 +138,6 @@ |
||
138 | 138 | */ |
139 | 139 | protected function buildUrl(string $prefix): string |
140 | 140 | { |
141 | - return $this->isSubUrl() ? $prefix . $this->getValue() : $this->getValue(); |
|
141 | + return $this->isSubUrl() ? $prefix.$this->getValue() : $this->getValue(); |
|
142 | 142 | } |
143 | 143 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | // Feel free to override this method to change default URL or add meta |
75 | 75 | |
76 | - $url = $this->getSelfSubUrl($resource) . '/' . DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $name; |
|
76 | + $url = $this->getSelfSubUrl($resource).'/'.DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$name; |
|
77 | 77 | |
78 | 78 | return $this->getFactory()->createLink(true, $url, false); |
79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | // Feel free to override this method to change default URL or add meta |
87 | 87 | |
88 | - $url = $this->getSelfSubUrl($resource) . '/' . $name; |
|
88 | + $url = $this->getSelfSubUrl($resource).'/'.$name; |
|
89 | 89 | |
90 | 90 | return $this->getFactory()->createLink(true, $url, false); |
91 | 91 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | protected function getResourcesSubUrl(): string |
153 | 153 | { |
154 | 154 | if ($this->subUrl === null) { |
155 | - $this->subUrl = '/' . $this->getType(); |
|
155 | + $this->subUrl = '/'.$this->getType(); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | return $this->subUrl; |
@@ -165,6 +165,6 @@ discard block |
||
165 | 165 | */ |
166 | 166 | protected function getSelfSubUrl($resource): string |
167 | 167 | { |
168 | - return $this->getResourcesSubUrl() . '/' . $this->getId($resource); |
|
168 | + return $this->getResourcesSubUrl().'/'.$this->getId($resource); |
|
169 | 169 | } |
170 | 170 | } |
@@ -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 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | /** @var string */ |
49 | 49 | public const MSG_CAN_NOT_PARSE_RELATIONSHIP = |
50 | - 'For resource of type `%s` with ID `%s` relationship `%s` cannot be parsed because it either ' . |
|
50 | + 'For resource of type `%s` with ID `%s` relationship `%s` cannot be parsed because it either '. |
|
51 | 51 | 'has `null` or identifier as data. Skipping.'; |
52 | 52 | |
53 | 53 | /** |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | foreach ($paths as $path) { |
534 | 534 | $curPath = ''; |
535 | 535 | foreach (explode($separator, $path) as $pathPart) { |
536 | - $curPath = empty($curPath) === true ? $pathPart : $curPath . $separator . $pathPart; |
|
536 | + $curPath = empty($curPath) === true ? $pathPart : $curPath.$separator.$pathPart; |
|
537 | 537 | $normalizedPaths[$curPath] = true; |
538 | 538 | } |
539 | 539 | } |
@@ -184,7 +184,7 @@ |
||
184 | 184 | { |
185 | 185 | assert( |
186 | 186 | call_user_func( |
187 | - function (array $paths): bool { |
|
187 | + function(array $paths): bool { |
|
188 | 188 | $pathsOk = true; |
189 | 189 | foreach ($paths as $path) { |
190 | 190 | $pathsOk = $pathsOk === true && is_string($path) === true && empty($path) === false; |
@@ -68,7 +68,7 @@ |
||
68 | 68 | { |
69 | 69 | assert( |
70 | 70 | $this->schemaContainer->hasSchema($resource), |
71 | - 'No Schema found for resource `' . get_class($resource) . '`.' |
|
71 | + 'No Schema found for resource `'.get_class($resource).'`.' |
|
72 | 72 | ); |
73 | 73 | |
74 | 74 | return $this->factory->createParsedResource( |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | $currentPath = $this->getPosition()->getPath(); |
174 | 174 | $nextLevel = $this->getPosition()->getLevel() + 1; |
175 | - $nextPathPrefix = empty($currentPath) === true ? '' : $currentPath . PositionInterface::PATH_SEPARATOR; |
|
175 | + $nextPathPrefix = empty($currentPath) === true ? '' : $currentPath.PositionInterface::PATH_SEPARATOR; |
|
176 | 176 | foreach ($this->getSchema()->getRelationships($this->getData()) as $name => $description) { |
177 | 177 | assert($this->assertRelationshipNameAndDescription($name, $description) === true); |
178 | 178 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | assert( |
188 | 188 | $hasData || $hasMeta || $hasLinks, |
189 | - "Relationship `$name` for type `" . $this->getType() . |
|
189 | + "Relationship `$name` for type `".$this->getType(). |
|
190 | 190 | '` MUST contain at least one of the following: links, data or meta.' |
191 | 191 | ); |
192 | 192 | |
@@ -445,11 +445,11 @@ discard block |
||
445 | 445 | { |
446 | 446 | assert( |
447 | 447 | is_string($name) === true && empty($name) === false, |
448 | - "Relationship names for type `" . $this->getType() . '` should be non-empty strings.' |
|
448 | + "Relationship names for type `".$this->getType().'` should be non-empty strings.' |
|
449 | 449 | ); |
450 | 450 | assert( |
451 | 451 | is_array($description) === true && empty($description) === false, |
452 | - "Relationship `$name` for type `" . $this->getType() . '` should be a non-empty array.' |
|
452 | + "Relationship `$name` for type `".$this->getType().'` should be a non-empty array.' |
|
453 | 453 | ); |
454 | 454 | |
455 | 455 | return true; |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | $nextPosition = $this->getFactory()->createPosition( |
484 | 484 | $nextLevel, |
485 | - $nextPathPrefix . $name, |
|
485 | + $nextPathPrefix.$name, |
|
486 | 486 | $this->getType(), |
487 | 487 | $name |
488 | 488 | ); |