@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | // debug check all fields are strings |
94 | 94 | assert( |
95 | - (function () use ($fields) { |
|
95 | + (function() use ($fields) { |
|
96 | 96 | $allAreStrings = !empty($fields); |
97 | 97 | foreach ($fields as $field) { |
98 | 98 | $allAreStrings = $allAreStrings === true && is_string($field) === true && empty($field) === false; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | // debug check all fields are strings |
136 | 136 | assert( |
137 | - (function () use ($fields) { |
|
137 | + (function() use ($fields) { |
|
138 | 138 | $allAreStrings = !empty($fields); |
139 | 139 | foreach ($fields as $field) { |
140 | 140 | $allAreStrings = $allAreStrings === true && is_string($field) === true && empty($field) === false; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | // debug check all fields are strings |
178 | 178 | assert( |
179 | - (function () use ($paths) { |
|
179 | + (function() use ($paths) { |
|
180 | 180 | $allAreStrings = !empty($paths); |
181 | 181 | foreach ($paths as $path) { |
182 | 182 | $allAreStrings = $allAreStrings === true && is_string($path) === true && empty($path) === false; |
@@ -439,7 +439,7 @@ |
||
439 | 439 | * @param string $parameterName |
440 | 440 | * @param array $value |
441 | 441 | * |
442 | - * @return iterable |
|
442 | + * @return Generator |
|
443 | 443 | * |
444 | 444 | * @SuppressWarnings(PHPMD.ElseExpression) |
445 | 445 | */ |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | * @param string $name |
271 | 271 | * @param iterable $operationsAndArgs |
272 | 272 | * |
273 | - * @return iterable |
|
273 | + * @return \Generator |
|
274 | 274 | */ |
275 | 275 | private function getValidatedOperationsAndArguments( |
276 | 276 | int $blockIndex, |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * @param string $name |
288 | 288 | * @param iterable $arguments |
289 | 289 | * |
290 | - * @return iterable |
|
290 | + * @return \Generator |
|
291 | 291 | */ |
292 | 292 | private function getValidatedArguments(int $blockIndex, string $name, iterable $arguments): iterable |
293 | 293 | { |
@@ -162,7 +162,7 @@ |
||
162 | 162 | protected function setWrapperErrors(array $wrapperErrors): self |
163 | 163 | { |
164 | 164 | if (empty($wrapperErrors) === false) { |
165 | - assert(call_user_func(function () use ($wrapperErrors) : bool { |
|
165 | + assert(call_user_func(function() use ($wrapperErrors) : bool { |
|
166 | 166 | $allAreErrors = true; |
167 | 167 | |
168 | 168 | foreach ($wrapperErrors as $error) { |
@@ -105,8 +105,7 @@ |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | $reply = $count > 0 ? |
108 | - BlockReplies::createSuccessReply($values) : |
|
109 | - BlockReplies::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
108 | + BlockReplies::createSuccessReply($values) : BlockReplies::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
110 | 109 | |
111 | 110 | return $reply; |
112 | 111 | } |
@@ -86,8 +86,7 @@ |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | $reply = $foundInvalidType === null ? |
89 | - BlockReplies::createSuccessReply($indexes) : |
|
90 | - BlockReplies::createErrorReply($context, $foundInvalidType, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
89 | + BlockReplies::createSuccessReply($indexes) : BlockReplies::createErrorReply($context, $foundInvalidType, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
91 | 90 | |
92 | 91 | return $reply; |
93 | 92 | } |
@@ -77,8 +77,7 @@ |
||
77 | 77 | assert(is_scalar($index) === true && is_scalar($type) === true); |
78 | 78 | $expectedType = $context->getProperties()->getProperty(self::PROPERTY_RESOURCE_TYPE); |
79 | 79 | $reply = $type === $expectedType ? |
80 | - BlockReplies::createSuccessReply($index) : |
|
81 | - BlockReplies::createErrorReply($context, $type, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
80 | + BlockReplies::createSuccessReply($index) : BlockReplies::createErrorReply($context, $type, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
82 | 81 | |
83 | 82 | return $reply; |
84 | 83 | } |
@@ -101,8 +101,7 @@ |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | $reply = $count <= 0 ? |
104 | - BlockReplies::createSuccessReply($value) : |
|
105 | - BlockReplies::createErrorReply($context, $value, ErrorCodes::UNIQUE_IN_DATABASE_SINGLE); |
|
104 | + BlockReplies::createSuccessReply($value) : BlockReplies::createErrorReply($context, $value, ErrorCodes::UNIQUE_IN_DATABASE_SINGLE); |
|
106 | 105 | |
107 | 106 | return $reply; |
108 | 107 | } |
@@ -101,8 +101,7 @@ |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | $reply = $count > 0 ? |
104 | - BlockReplies::createSuccessReply($value) : |
|
105 | - BlockReplies::createErrorReply($context, $value, ErrorCodes::EXIST_IN_DATABASE_SINGLE); |
|
104 | + BlockReplies::createSuccessReply($value) : BlockReplies::createErrorReply($context, $value, ErrorCodes::EXIST_IN_DATABASE_SINGLE); |
|
106 | 105 | |
107 | 106 | return $reply; |
108 | 107 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | public function getMappedIncludes(): iterable |
246 | 246 | { |
247 | 247 | $fromScheme = $this->getRootScheme(); |
248 | - $getMappedRelLinks = function (iterable $links) use ($fromScheme) : iterable { |
|
248 | + $getMappedRelLinks = function(iterable $links) use ($fromScheme) : iterable { |
|
249 | 249 | foreach ($links as $link) { |
250 | 250 | assert(is_string($link)); |
251 | 251 | $fromSchemaClass = get_class($fromScheme); |
@@ -289,14 +289,14 @@ discard block |
||
289 | 289 | // ['rel2_name1', ], |
290 | 290 | // ['rel3_name1', 'rel3_name2', 'rel3_name3', ], |
291 | 291 | // ] |
292 | - $includeAsModelNames = function (iterable $relationships): iterable { |
|
292 | + $includeAsModelNames = function(iterable $relationships): iterable { |
|
293 | 293 | foreach ($relationships as $relationship) { |
294 | 294 | assert($relationship instanceof RelationshipInterface); |
295 | 295 | yield $relationship->getNameInModel(); |
296 | 296 | } |
297 | 297 | }; |
298 | 298 | $mappedIncludes = $this->getMappedIncludes(); |
299 | - $getIncludes = function () use ($mappedIncludes, $includeAsModelNames) : iterable { |
|
299 | + $getIncludes = function() use ($mappedIncludes, $includeAsModelNames) : iterable { |
|
300 | 300 | foreach ($mappedIncludes as $relationships) { |
301 | 301 | yield $includeAsModelNames($relationships); |
302 | 302 | } |
@@ -409,7 +409,7 @@ |
||
409 | 409 | * @param string $parameterName |
410 | 410 | * @param iterable $value |
411 | 411 | * |
412 | - * @return iterable |
|
412 | + * @return Generator |
|
413 | 413 | * |
414 | 414 | * @SuppressWarnings(PHPMD.CyclomaticComplexity) |
415 | 415 | */ |