@@ -22,7 +22,7 @@ |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | // Toss out the first and last lines. |
| 25 | - $lines = array_slice($lines, 1, count($lines) - 2); |
|
| 25 | + $lines = array_slice($lines, 1, count($lines)-2); |
|
| 26 | 26 | |
| 27 | 27 | // take the tabs from the first line, and subtract them from all lines |
| 28 | 28 | $matches = []; |
@@ -183,7 +183,7 @@ |
||
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /** |
| 186 | - * @return mixed|string|string[]|null |
|
| 186 | + * @return string |
|
| 187 | 187 | * |
| 188 | 188 | * @throws ReflectionException |
| 189 | 189 | */ |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | 'name' => $name, |
| 64 | 64 | 'resolve' => function ($value, $args1, $context, $info) use ($config, $args) { |
| 65 | 65 | // validate inputs |
| 66 | - $config['type'] = new InputObjectType([ |
|
| 66 | + $config['type'] = new InputObjectType([ |
|
| 67 | 67 | 'name'=>'', |
| 68 | 68 | 'fields' => $args, |
| 69 | 69 | ]); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | if ($arr === []) { |
| 89 | 89 | return false; |
| 90 | 90 | } |
| 91 | - return array_keys($arr) !== range(0, count($arr) - 1); |
|
| 91 | + return array_keys($arr) !== range(0, count($arr)-1); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $newPath[] = 0; |
| 107 | 107 | $this->_validateItems($subValue, $newPath, $validate); |
| 108 | 108 | } else { |
| 109 | - $path[count($path) - 1] = $idx; |
|
| 109 | + $path[count($path)-1] = $idx; |
|
| 110 | 110 | $err = $validate($subValue); |
| 111 | 111 | |
| 112 | 112 | if ($err) { |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use GraphQL\Type\Definition\InputObjectType; |
| 10 | 10 | use GraphQL\Type\Definition\ObjectType; |
| 11 | 11 | use GraphQL\Type\Definition\Type; |
| 12 | -use GraphQL\Type\Definition\UserErrorsType; |
|
| 13 | 12 | use GraphQL\Type\Definition\ValidatedFieldDefinition; |
| 14 | 13 | use GraphQL\Type\Schema; |
| 15 | 14 | use PHPUnit\Framework\TestCase; |
@@ -101,10 +101,10 @@ |
||
| 101 | 101 | 'bookAttributes' => [ |
| 102 | 102 | 'type' => Type::listOf($this->bookAttributesInputType), |
| 103 | 103 | 'validate' => static function ($var) { |
| 104 | - return $var ? 0: 1; |
|
| 104 | + return $var ? 0 : 1; |
|
| 105 | 105 | }, |
| 106 | 106 | 'validateItem' => static function ($book) { |
| 107 | - return isset($book['author']) || isset($book['title']) ? 0: 1; |
|
| 107 | + return isset($book['author']) || isset($book['title']) ? 0 : 1; |
|
| 108 | 108 | }, |
| 109 | 109 | ], |
| 110 | 110 | ], |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | [ |
| 107 | 107 | 'suberrors' => |
| 108 | 108 | [ |
| 109 | - 'path' => [0,1], |
|
| 109 | + 'path' => [0, 1], |
|
| 110 | 110 | 'code' => 'invalidPhoneNumber', |
| 111 | 111 | ], |
| 112 | 112 | ], |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | $type = $config['type']; |
| 92 | 92 | foreach ($type->getFields() as $key => $field) { |
| 93 | 93 | $newType = static::create( |
| 94 | - $field->config + ['typeSetter' => $config['typeSetter'] ?? null], |
|
| 94 | + $field->config+['typeSetter' => $config['typeSetter'] ?? null], |
|
| 95 | 95 | array_merge($path, [$key]) |
| 96 | 96 | ); |
| 97 | 97 | |
@@ -50,6 +50,9 @@ discard block |
||
| 50 | 50 | ]); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | + /** |
|
| 54 | + * @param string[] $path |
|
| 55 | + */ |
|
| 53 | 56 | protected function _buildListOfType($config, $path, &$finalFields) { |
| 54 | 57 | $type = $config['type']; |
| 55 | 58 | $wrappedType = $type->getWrappedType(true); |
@@ -77,6 +80,9 @@ discard block |
||
| 77 | 80 | } |
| 78 | 81 | } |
| 79 | 82 | |
| 83 | + /** |
|
| 84 | + * @param string[] $path |
|
| 85 | + */ |
|
| 80 | 86 | protected function _buildInputObjectType($config, $path, &$finalFields) { |
| 81 | 87 | $fields = []; |
| 82 | 88 | $type = $config['type']; |
@@ -117,6 +123,9 @@ discard block |
||
| 117 | 123 | } |
| 118 | 124 | } |
| 119 | 125 | |
| 126 | + /** |
|
| 127 | + * @param string[] $path |
|
| 128 | + */ |
|
| 120 | 129 | protected function _addErrorCodes($config, &$finalFields, $path) { |
| 121 | 130 | if (isset($config['errorCodes'])) { |
| 122 | 131 | if (!isset($config['validate'])) { |