@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | 'title' => [ |
| 62 | 62 | 'type' => Type::string(), |
| 63 | 63 | 'description' => 'Enter a book title, no more than 10 characters in length', |
| 64 | - 'validate' => static function (string $title) { |
|
| 64 | + 'validate' => static function(string $title) { |
|
| 65 | 65 | if (strlen($title) > 10) { |
| 66 | 66 | return [1, 'book title must be less than 10 chaacters']; |
| 67 | 67 | } |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | 'unknownAuthor', |
| 76 | 76 | 'authorDeceased', |
| 77 | 77 | ], |
| 78 | - 'validate' => function (string $authorId) { |
|
| 79 | - if (! isset($this->data['people'][$authorId])) { |
|
| 78 | + 'validate' => function(string $authorId) { |
|
| 79 | + if (!isset($this->data['people'][$authorId])) { |
|
| 80 | 80 | return ['unknownAuthor', 'We have no record of that author']; |
| 81 | 81 | } |
| 82 | 82 | return 0; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | 'query' => $this->query, |
| 92 | 92 | 'mutation' => new ObjectType([ |
| 93 | 93 | 'name' => 'Mutation', |
| 94 | - 'fields' => function () { |
|
| 94 | + 'fields' => function() { |
|
| 95 | 95 | return [ |
| 96 | 96 | 'updateBook' => new ValidatedFieldDefinition([ |
| 97 | 97 | 'name' => 'updateBook', |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'bookAttributes' => [ |
| 101 | 101 | 'type' => $this->bookAttributesInputType, |
| 102 | 102 | 'errorCodes' => ['titleOrIdRequired'], |
| 103 | - 'validate' => static function (?array $bookAttributes) { |
|
| 103 | + 'validate' => static function(?array $bookAttributes) { |
|
| 104 | 104 | if (!$bookAttributes) { |
| 105 | 105 | return 0; |
| 106 | 106 | } |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | }, |
| 113 | 113 | ], |
| 114 | 114 | ], |
| 115 | - 'resolve' => static function ($value, $args) : bool { |
|
| 115 | + 'resolve' => static function($value, $args) : bool { |
|
| 116 | 116 | // ... |
| 117 | 117 | // do update |
| 118 | 118 | // ... |
| 119 | 119 | |
| 120 | - return ! $value; |
|
| 120 | + return !$value; |
|
| 121 | 121 | }, |
| 122 | 122 | ]), |
| 123 | 123 | ]; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $this->expectExceptionMessage('You must specify a type for your field'); |
| 38 | 38 | UserErrorsType::create([ |
| 39 | - 'validate' => static function ($value) { |
|
| 39 | + 'validate' => static function($value) { |
|
| 40 | 40 | return $value ? 0 : 1; |
| 41 | 41 | }, |
| 42 | 42 | ], ['upsertSku']); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function testValidationWithNoErrorCodes() |
| 46 | 46 | { |
| 47 | 47 | $type = UserErrorsType::create([ |
| 48 | - 'validate' => static function ($value) { |
|
| 48 | + 'validate' => static function($value) { |
|
| 49 | 49 | return $value ? 0 : 1; |
| 50 | 50 | }, |
| 51 | 51 | 'type' => Type::id(), |