@@ -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; |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | private $httpCode; |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * @param ErrorInterface|iterable $errors |
|
| 57 | + * @param ErrorInterface $errors |
|
| 58 | 58 | * @param int $httpCode |
| 59 | 59 | * @param Exception|null $previous |
| 60 | 60 | * |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param array $parameters |
| 31 | 31 | * @param string $errorTitle |
| 32 | 32 | * |
| 33 | - * @return iterable |
|
| 33 | + * @return \Generator |
|
| 34 | 34 | */ |
| 35 | 35 | protected function getIncludes(array $parameters, string $errorTitle): iterable |
| 36 | 36 | { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @param array $parameters |
| 48 | 48 | * @param string $errorTitle |
| 49 | 49 | * |
| 50 | - * @return iterable |
|
| 50 | + * @return \Generator |
|
| 51 | 51 | */ |
| 52 | 52 | protected function getFields(array $parameters, string $errorTitle): iterable |
| 53 | 53 | { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @param array $parameters |
| 68 | 68 | * @param string $errorTitle |
| 69 | 69 | * |
| 70 | - * @return iterable |
|
| 70 | + * @return \Generator |
|
| 71 | 71 | */ |
| 72 | 72 | protected function getSorts(array $parameters, string $errorTitle): iterable |
| 73 | 73 | { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @param array $parameters |
| 100 | 100 | * @param string $errorTitle |
| 101 | 101 | * |
| 102 | - * @return iterable |
|
| 102 | + * @return \Generator |
|
| 103 | 103 | */ |
| 104 | 104 | protected function getProfileUrls(array $parameters, string $errorTitle): iterable |
| 105 | 105 | { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @param string|mixed $shouldBeString |
| 120 | 120 | * @param string $errorTitle |
| 121 | 121 | * |
| 122 | - * @return iterable |
|
| 122 | + * @return \Generator |
|
| 123 | 123 | */ |
| 124 | 124 | private function splitCommaSeparatedStringAndCheckNoEmpties( |
| 125 | 125 | string $paramName, |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | 133 | * @param string $paramName |
| 134 | - * @param string|mixed $shouldBeString |
|
| 134 | + * @param string $shouldBeString |
|
| 135 | 135 | * @param string $errorTitle |
| 136 | 136 | * |
| 137 | - * @return iterable |
|
| 137 | + * @return \Generator |
|
| 138 | 138 | */ |
| 139 | 139 | private function splitSpaceSeparatedStringAndCheckNoEmpties( |
| 140 | 140 | string $paramName, |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @param string $separator |
| 151 | 151 | * @param string $errorTitle |
| 152 | 152 | * |
| 153 | - * @return iterable |
|
| 153 | + * @return \Generator |
|
| 154 | 154 | */ |
| 155 | 155 | private function splitStringAndCheckNoEmpties( |
| 156 | 156 | string $paramName, |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | - * @param mixed $identifier |
|
| 82 | + * @param SchemaIdentifierInterface $identifier |
|
| 83 | 83 | * |
| 84 | 84 | * @return ResourceInterface |
| 85 | 85 | */ |
@@ -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( |
@@ -448,7 +448,7 @@ |
||
| 448 | 448 | * @param bool $addSelfLink |
| 449 | 449 | * @param bool $addRelatedLink |
| 450 | 450 | * |
| 451 | - * @return iterable |
|
| 451 | + * @return \Generator |
|
| 452 | 452 | */ |
| 453 | 453 | private function parseLinks( |
| 454 | 454 | string $relationshipName, |
@@ -175,15 +175,15 @@ discard block |
||
| 175 | 175 | $currentType = $this->getType(); |
| 176 | 176 | $currentPath = $this->getPosition()->getPath(); |
| 177 | 177 | $nextLevel = $this->getPosition()->getLevel() + 1; |
| 178 | - $nextPathPrefix = empty($currentPath) === true ? '' : $currentPath . PositionInterface::PATH_SEPARATOR; |
|
| 178 | + $nextPathPrefix = empty($currentPath) === true ? '' : $currentPath.PositionInterface::PATH_SEPARATOR; |
|
| 179 | 179 | foreach ($this->getSchema()->getRelationships($this->getData()) as $name => $description) { |
| 180 | 180 | assert( |
| 181 | 181 | is_string($name) === true && empty($name) === false, |
| 182 | - "Relationship names for type `" . $currentType . '` should be non-empty strings.' |
|
| 182 | + "Relationship names for type `".$currentType.'` should be non-empty strings.' |
|
| 183 | 183 | ); |
| 184 | 184 | assert( |
| 185 | 185 | is_array($description) === true && empty($description) === false, |
| 186 | - "Relationship `$name` for type `" . $currentType . '` should be a non-empty array.' |
|
| 186 | + "Relationship `$name` for type `".$currentType.'` should be a non-empty array.' |
|
| 187 | 187 | ); |
| 188 | 188 | |
| 189 | 189 | $hasData = array_key_exists(SchemaInterface::RELATIONSHIP_DATA, $description); |
@@ -230,13 +230,13 @@ discard block |
||
| 230 | 230 | $hasLinks = $addSelfLink === true || $addRelatedLink === true || empty($schemaLinks) === false; |
| 231 | 231 | assert( |
| 232 | 232 | $hasData || $hasMeta || $hasLinks, |
| 233 | - "Relationship `$name` for type `" . $currentType . |
|
| 233 | + "Relationship `$name` for type `".$currentType. |
|
| 234 | 234 | '` MUST contain at least one of the following: links, data or meta.' |
| 235 | 235 | ); |
| 236 | 236 | |
| 237 | 237 | $nextPosition = $this->getFactory()->createPosition( |
| 238 | 238 | $nextLevel, |
| 239 | - $nextPathPrefix . $name, |
|
| 239 | + $nextPathPrefix.$name, |
|
| 240 | 240 | $currentType, |
| 241 | 241 | $name |
| 242 | 242 | ); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | * @see ResourceInterface |
| 204 | 204 | * @see IdentifierInterface |
| 205 | 205 | * |
| 206 | - * @return iterable |
|
| 206 | + * @return \Generator |
|
| 207 | 207 | */ |
| 208 | 208 | private function parseAsResourcesOrIdentifiers( |
| 209 | 209 | PositionInterface $position, |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * |
| 226 | 226 | * @see ResourceInterface |
| 227 | 227 | * |
| 228 | - * @return iterable |
|
| 228 | + * @return \Generator |
|
| 229 | 229 | * |
| 230 | 230 | */ |
| 231 | 231 | private function parseAsResource( |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | /** |
| 247 | 247 | * @param ResourceInterface $resource |
| 248 | 248 | * |
| 249 | - * @return iterable |
|
| 249 | + * @return \Generator |
|
| 250 | 250 | */ |
| 251 | 251 | private function parseResource(ResourceInterface $resource): iterable |
| 252 | 252 | { |
@@ -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 | } |
@@ -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 | } |
@@ -819,7 +819,7 @@ |
||
| 819 | 819 | * @param iterable $iterable1 |
| 820 | 820 | * @param iterable $iterable2 |
| 821 | 821 | * |
| 822 | - * @return iterable |
|
| 822 | + * @return \Generator |
|
| 823 | 823 | */ |
| 824 | 824 | private function mergeIterables(iterable $iterable1, iterable $iterable2): iterable |
| 825 | 825 | { |
@@ -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; |