@@ -28,7 +28,7 @@ |
||
| 28 | 28 | /** @var AbstractObjectType $objectType */ |
| 29 | 29 | if (!(TypeService::isObjectType($objectType) || TypeService::isInputObjectType($objectType)) || !$objectType->hasField($ast->getName())) { |
| 30 | 30 | $availableFieldNames = implode(', ', array_map(function (FieldInterface $field) { |
| 31 | - return sprintf('"%s"', $field->getName()); |
|
| 31 | + return sprintf('"%s"', $field->getName()); |
|
| 32 | 32 | }, $objectType->getFields())); |
| 33 | 33 | throw new ResolveException(sprintf('Field "%s" not found in type "%s". Available fields are: %s', $ast->getName(), $objectType->getNamedType()->getName(), $availableFieldNames), $ast->getLocation()); |
| 34 | 34 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | /** @var AbstractObjectType $objectType */ |
| 29 | 29 | if (!(TypeService::isObjectType($objectType) || TypeService::isInputObjectType($objectType)) || !$objectType->hasField($ast->getName())) { |
| 30 | - $availableFieldNames = implode(', ', array_map(function (FieldInterface $field) { |
|
| 30 | + $availableFieldNames = implode(', ', array_map(function(FieldInterface $field) { |
|
| 31 | 31 | return sprintf('"%s"', $field->getName()); |
| 32 | 32 | }, $objectType->getFields())); |
| 33 | 33 | throw new ResolveException(sprintf('Field "%s" not found in type "%s". Available fields are: %s', $ast->getName(), $objectType->getNamedType()->getName(), $availableFieldNames), $ast->getLocation()); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public function assertValidArguments(FieldInterface $field, AstFieldInterface $query, Request $request) |
| 38 | 38 | { |
| 39 | - $requiredArguments = array_filter($field->getArguments(), function (InputField $argument) { |
|
| 39 | + $requiredArguments = array_filter($field->getArguments(), function(InputField $argument) { |
|
| 40 | 40 | return $argument->getType()->getKind() === TypeMap::KIND_NON_NULL; |
| 41 | 41 | }); |
| 42 | 42 | |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | public function isValidValue($value) |
| 34 | 34 | { |
| 35 | 35 | if (!is_null($value) && !is_array($value) && !($value instanceof \Traversable)) { |
| 36 | - $this->lastError = 'The value is not an iterable.'; |
|
| 37 | - return false; |
|
| 36 | + $this->lastError = 'The value is not an iterable.'; |
|
| 37 | + return false; |
|
| 38 | 38 | } |
| 39 | 39 | $this->lastError = null; |
| 40 | 40 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | if ($value && $itemType->isInputType()) { |
| 44 | 44 | foreach ($value as $item) { |
| 45 | 45 | if (!$itemType->isValidValue($item)) { |
| 46 | - return false; |
|
| 46 | + return false; |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | if ($value === null) { |
| 58 | 58 | $this->lastError = 'Field must not be NULL'; |
| 59 | 59 | return false; |
| 60 | - } |
|
| 61 | - else { |
|
| 60 | + } else { |
|
| 62 | 61 | $this->lastError = null; |
| 63 | 62 | } |
| 64 | 63 | |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $allowedValues = array_map(function (array $value) { |
|
| 59 | + $allowedValues = array_map(function(array $value) { |
|
| 60 | 60 | return sprintf('%s (%s)', $value['name'], $value['value']); |
| 61 | 61 | }, $this->getConfig()->get('values')); |
| 62 | 62 | $this->lastError = sprintf('Value must be one of the allowed ones: %s', implode(', ', $allowedValues)); |
@@ -48,7 +48,9 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public function isValidValue($value) |
| 50 | 50 | { |
| 51 | - if (is_null($value)) return true; |
|
| 51 | + if (is_null($value)) { |
|
| 52 | + return true; |
|
| 53 | + } |
|
| 52 | 54 | foreach ($this->getConfig()->get('values') as $item) { |
| 53 | 55 | if ($value === $item['name'] || $value === $item['value']) { |
| 54 | 56 | $this->lastError = null; |