Passed
Pull Request — master (#1)
by Max
03:53 queued 43s
created
tests/Utils.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     {
18 18
         $lines = preg_split('/\\n/', $str);
19 19
 
20
-        if($lines === false) {
20
+        if ($lines === false) {
21 21
             return '';
22 22
         }
23 23
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         }
27 27
 
28 28
         // Toss out the first and last lines.
29
-        $lines = array_slice($lines, 1, count($lines) - 2);
29
+        $lines = array_slice($lines, 1, count($lines)-2);
30 30
 
31 31
         // take the tabs from the first line, and subtract them from all lines
32 32
         $matches = [];
Please login to merge, or discard this patch.
tests/Type/ValidatedFieldDefinition/ScalarValidationTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,13 +55,13 @@  discard block
 block discarded – undo
55 55
             'fields' => [
56 56
                 'title' => [
57 57
                     'type' => Type::string(),
58
-                    'resolve' => static function ($book) {
58
+                    'resolve' => static function($book) {
59 59
                         return $book['title'];
60 60
                     },
61 61
                 ],
62 62
                 'author' => [
63 63
                     'type' => $this->personType,
64
-                    'resolve' => static function ($book) {
64
+                    'resolve' => static function($book) {
65 65
                         return $book['author'];
66 66
                     },
67 67
                 ],
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             'query' => $this->query,
75 75
             'mutation' => new ObjectType([
76 76
                 'name' => 'Mutation',
77
-                'fields' => function () {
77
+                'fields' => function() {
78 78
                     return [
79 79
                         'updateBook' => new ValidatedFieldDefinition([
80 80
                             'name' => 'updateBook',
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                                 'bookId' => [
84 84
                                     'type' => Type::id(),
85 85
                                     'errorCodes' => ['bookNotFound'],
86
-                                    'validate' => function ($bookId) {
86
+                                    'validate' => function($bookId) {
87 87
                                         if (isset($this->data['books'][$bookId])) {
88 88
                                             return 0;
89 89
                                         }
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
                                     },
93 93
                                 ],
94 94
                             ],
95
-                            'resolve' => static function ($value) : bool {
96
-                                return ! ! $value;
95
+                            'resolve' => static function($value) : bool {
96
+                                return !!$value;
97 97
                             },
98 98
                         ]),
99 99
                     ];
Please login to merge, or discard this patch.
tests/Type/UserErrorsType/ListOfTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $type = new UserErrorsType([
40 40
             'type' => Type::listOf(Type::id()),
41 41
             'errorCodes'=> ['atLeastOneRequired'],
42
-            'validate' => static function ($value) {
42
+            'validate' => static function($value) {
43 43
                 return $value ? 0 : 1;
44 44
             },
45 45
         ], ['users']);
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
         $type = new UserErrorsType([
72 72
             'type' => Type::listOf(Type::listOf(Type::listOf(Type::id()))),
73 73
             'errorCodes'=> ['atLeastOneRequired'],
74
-            'validate' => static function ($value) {
74
+            'validate' => static function($value) {
75 75
                 return $value ? 0 : 1;
76 76
             },
77
-            'validateItem' => static function ($value) {
77
+            'validateItem' => static function($value) {
78 78
                 return $value ? 0 : 1;
79 79
             },
80 80
         ], ['users']);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     public function testListOfInputObjectWithValidationOnSelf()
120 120
     {
121 121
         $type = new UserErrorsType([
122
-            'validate' => static function (array $authors) {
122
+            'validate' => static function(array $authors) {
123 123
                 if (count($authors) < 1) {
124 124
                     return ['atLeastOneAuthorRequired', 'You must submit at least one author'];
125 125
                 }
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
     {
165 165
         $type = new UserErrorsType([
166 166
             'suberrorCodes' => ['firstNameOrLastNameRequired'],
167
-            'validateItem' => static function (array $author) {
168
-                if (! isset($author['firstName']) && ! isset($author['lastName'])) {
167
+            'validateItem' => static function(array $author) {
168
+                if (!isset($author['firstName']) && !isset($author['lastName'])) {
169 169
                     return ['atLeastOneAuthorRequired', 'You must submit a first name or a last name'];
170 170
                 }
171 171
             },
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                 'fields' => [
175 175
                     'firstName' => [
176 176
                         'type' => Type::string(),
177
-                        'validate' => static function (string $name) {
177
+                        'validate' => static function(string $name) {
178 178
                             return $name ? 0 : 1;
179 179
                         },
180 180
                     ],
Please login to merge, or discard this patch.