@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Date: 03.12.15 |
|
| 4 | - * |
|
| 5 | - * @author Portey Vasil <[email protected]> |
|
| 6 | - */ |
|
| 3 | + * Date: 03.12.15 |
|
| 4 | + * |
|
| 5 | + * @author Portey Vasil <[email protected]> |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | namespace Youshido\GraphQL\Definition; |
| 9 | 9 | |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Date: 04.12.15 |
|
| 4 | - * |
|
| 5 | - * @author Portey Vasil <[email protected]> |
|
| 6 | - */ |
|
| 3 | + * Date: 04.12.15 |
|
| 4 | + * |
|
| 5 | + * @author Portey Vasil <[email protected]> |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | namespace Youshido\GraphQL\Definition\Traits; |
| 9 | 9 | |
@@ -226,10 +226,10 @@ |
||
| 226 | 226 | |
| 227 | 227 | $value = substr($this->source, $start, $this->pos - $start); |
| 228 | 228 | |
| 229 | - if(strpos($value, '.') === false){ |
|
| 230 | - $value = (int) $value; |
|
| 229 | + if (strpos($value, '.') === false) { |
|
| 230 | + $value = (int)$value; |
|
| 231 | 231 | } else { |
| 232 | - $value = (float) $value; |
|
| 232 | + $value = (float)$value; |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | return new Token(Token::TYPE_NUMBER, $value); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Date: 04.12.15 |
|
| 4 | - * |
|
| 5 | - * @author Portey Vasil <[email protected]> |
|
| 6 | - */ |
|
| 3 | + * Date: 04.12.15 |
|
| 4 | + * |
|
| 5 | + * @author Portey Vasil <[email protected]> |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | namespace Youshido\GraphQL\Definition\Traits; |
| 9 | 9 | |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Date: 23.11.15 |
|
| 4 | - * |
|
| 5 | - * @author Portey Vasil <[email protected]> |
|
| 6 | - */ |
|
| 3 | + * Date: 23.11.15 |
|
| 4 | + * |
|
| 5 | + * @author Portey Vasil <[email protected]> |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | namespace Youshido\GraphQL; |
| 9 | 9 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | - * @return Field[]|Query[] |
|
| 64 | + * @return Query[] |
|
| 65 | 65 | */ |
| 66 | 66 | public function getFields() |
| 67 | 67 | { |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | - * @return Field[]|Query[] |
|
| 64 | + * @return Query[] |
|
| 65 | 65 | */ |
| 66 | 66 | public function getFields() |
| 67 | 67 | { |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Date: 03.12.15 |
|
| 4 | - * |
|
| 5 | - * @author Portey Vasil <[email protected]> |
|
| 6 | - */ |
|
| 3 | + * Date: 03.12.15 |
|
| 4 | + * |
|
| 5 | + * @author Portey Vasil <[email protected]> |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | namespace Youshido\GraphQL\Definition; |
| 9 | 9 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | ->addField('kind', 'string') |
| 22 | 22 | ->addField('description', 'string') |
| 23 | 23 | ->addField('ofType', new QueryListType(), [ |
| 24 | - 'resolve' => function () { |
|
| 24 | + 'resolve' => function() { |
|
| 25 | 25 | return []; |
| 26 | 26 | } |
| 27 | 27 | ]) |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | /** |
| 190 | 190 | * @param $objectType InputObjectType|ObjectType |
| 191 | 191 | * @param $query Mutation|Query |
| 192 | - * @return null |
|
| 192 | + * @return boolean |
|
| 193 | 193 | */ |
| 194 | 194 | private function checkFieldExist($objectType, $query) |
| 195 | 195 | { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | - * @param $field Field |
|
| 229 | + * @param Field $field Field |
|
| 230 | 230 | * @param $contextValue mixed |
| 231 | 231 | * @param $query Query |
| 232 | 232 | * |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $preResolvedValue = $this->getPreResolvedValue($contextValue, $query); |
| 157 | 157 | |
| 158 | 158 | if ($field->getConfig()->getType()->getKind() == TypeMap::KIND_LIST) { |
| 159 | - if(!is_array($preResolvedValue)){ |
|
| 159 | + if (!is_array($preResolvedValue)) { |
|
| 160 | 160 | $value = null; |
| 161 | 161 | $this->resolveValidator->addError(new ResolveException('Not valid resolve value for list type')); |
| 162 | 162 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | if ($type->getKind() == TypeMap::KIND_ENUM) { |
| 171 | 171 | /** @var $type AbstractEnumType */ |
| 172 | - if(!$type->isValidValue($resolvedValueItem)) { |
|
| 172 | + if (!$type->isValidValue($resolvedValueItem)) { |
|
| 173 | 173 | $this->resolveValidator->addError(new ResolveException('Not valid value for enum type')); |
| 174 | 174 | |
| 175 | 175 | $listValue = null; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $value = $listValue; |
| 187 | 187 | } else { |
| 188 | 188 | if ($field->getType()->getKind() == TypeMap::KIND_ENUM) { |
| 189 | - if(!$field->getType()->isValidValue($preResolvedValue)) { |
|
| 189 | + if (!$field->getType()->isValidValue($preResolvedValue)) { |
|
| 190 | 190 | $this->resolveValidator->addError(new ResolveException('Not valid value for enum type')); |
| 191 | 191 | $value = null; |
| 192 | 192 | } else { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $value[] = []; |
| 218 | 218 | $index = count($value) - 1; |
| 219 | 219 | |
| 220 | - if($field->getConfig()->getType()->getConfig()->getItem()->getKind() == TypeMap::KIND_INTERFACE) { |
|
| 220 | + if ($field->getConfig()->getType()->getConfig()->getItem()->getKind() == TypeMap::KIND_INTERFACE) { |
|
| 221 | 221 | $resolvedValueItem = $field->getConfig()->getType()->getConfig()->getItemConfig()->resolveType($resolvedValueItem); |
| 222 | 222 | $type = $field->getConfig()->getType()->getConfig()->getItem(); |
| 223 | 223 | } else { |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | { |
| 288 | 288 | $resolvedValue = $field->getConfig()->resolve($contextValue, $this->parseArgumentsValues($field, $query)); |
| 289 | 289 | |
| 290 | - if($field->getType()->getKind() == TypeMap::KIND_INTERFACE){ |
|
| 290 | + if ($field->getType()->getKind() == TypeMap::KIND_INTERFACE) { |
|
| 291 | 291 | $resolvedValue = $field->getType()->resolveType($resolvedValue); |
| 292 | 292 | } |
| 293 | 293 | |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | return []; |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | - $args = []; |
|
| 309 | + $args = []; |
|
| 310 | 310 | foreach ($query->getArguments() as $argument) { |
| 311 | 311 | $args[$argument->getName()] = $field->getConfig()->getArgument($argument->getName())->getType()->parseValue($argument->getValue()->getValue()); |
| 312 | 312 | } |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | foreach ($fragment->getFields() as $fragmentField) { |
| 340 | 340 | $value = $this->collectValue($value, $this->executeQuery($fragmentField, $queryType, $resolvedValue)); |
| 341 | 341 | } |
| 342 | - } else if($field->getName() == self::TYPE_NAME_QUERY) { |
|
| 342 | + } else if ($field->getName() == self::TYPE_NAME_QUERY) { |
|
| 343 | 343 | $value = $this->collectValue($value, [$field->getAlias() ?: $field->getName() => $queryType->getName()]); |
| 344 | 344 | } else { |
| 345 | 345 | $value = $this->collectValue($value, $this->executeQuery($field, $queryType, $resolvedValue)); |