Completed
Push — master ( 2439c1...085721 )
by Rafael
04:04
created
src/Cache/DefinitionCacheWarmer.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,9 +103,9 @@
 block discarded – undo
103 103
 
104 104
         /** @var iterable $files */
105 105
         $files = Finder::create()
106
-                       ->in($dirs)
107
-                       ->date(sprintf('>= %s', date('Y-m-d H:i:s', $controlTime)))
108
-                       ->files();
106
+                        ->in($dirs)
107
+                        ->date(sprintf('>= %s', date('Y-m-d H:i:s', $controlTime)))
108
+                        ->files();
109 109
 
110 110
         //exist at least one modified file
111 111
         foreach ($files as $file) {
Please login to merge, or discard this patch.
src/Type/Definition/InterfaceDefinitionType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@
 block discarded – undo
43 43
             [
44 44
                 'name' => $definition->getName(),
45 45
                 'description' => $definition->getDescription(),
46
-                'fields' => function () use ($definition) {
46
+                'fields' => function() use ($definition) {
47 47
                     return GraphQLBuilder::resolveFields($definition);
48 48
                 },
49
-                'resolveType' => function ($value) {
49
+                'resolveType' => function($value) {
50 50
                     return TypeUtil::resolveObjectType($this->endpoint, $value);
51 51
                 },
52 52
             ]
Please login to merge, or discard this patch.
src/Definition/Registry/Endpoint.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      *
83 83
      * @return null|string
84 84
      */
85
-    public function getClassForType(string $type):?string
85
+    public function getClassForType(string $type): ?string
86 86
     {
87 87
         if (isset($this->typeMap[$type])) {
88 88
             return $this->typeMap[$type];
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     {
111 111
         $types = array_filter(
112 112
             $this->typeMap,
113
-            function ($val) use ($class) {
113
+            function($val) use ($class) {
114 114
                 return $val === $class;
115 115
             }
116 116
         );
Please login to merge, or discard this patch.
src/Command/SchemaExportCommand.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@
 block discarded – undo
42 42
     protected function configure()
43 43
     {
44 44
         $this->setName('graphql:schema:export')
45
-             ->setDescription('Export your schema.')
46
-             ->addOption('endpoint', null, InputOption::VALUE_REQUIRED, 'Name of the endpoint to export', DefinitionRegistry::DEFAULT_ENDPOINT)
47
-             ->addOption('output', 'o', InputOption::VALUE_REQUIRED, 'Name of the file to save the schema, e.i. schema.graphql or schema.json')
48
-             ->addOption('json', null, InputOption::VALUE_NONE, 'Create json output, automatically used if the output contains json extension');
45
+                ->setDescription('Export your schema.')
46
+                ->addOption('endpoint', null, InputOption::VALUE_REQUIRED, 'Name of the endpoint to export', DefinitionRegistry::DEFAULT_ENDPOINT)
47
+                ->addOption('output', 'o', InputOption::VALUE_REQUIRED, 'Name of the file to save the schema, e.i. schema.graphql or schema.json')
48
+                ->addOption('json', null, InputOption::VALUE_NONE, 'Create json output, automatically used if the output contains json extension');
49 49
     }
50 50
 
51 51
     /**
Please login to merge, or discard this patch.
src/Command/SchemaSnapshotCommand.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,11 +57,11 @@
 block discarded – undo
57 57
     protected function configure()
58 58
     {
59 59
         $this->setName('graphql:schema:snapshot')
60
-             ->setDescription('Create a snapshot of your schema to compare using behat tests.')
61
-             ->addOption('endpoint', null, InputOption::VALUE_REQUIRED, 'Name of the endpoint to export', DefinitionRegistry::DEFAULT_ENDPOINT)
62
-             ->addOption('all', 'a', InputOption::VALUE_NONE, 'Create snapshot for all registered endpoints')
63
-             ->addOption('strict', null, InputOption::VALUE_NONE, 'When use strict mode the snapshot must be updated every time your schema change')
64
-             ->addOption('features', null, InputOption::VALUE_REQUIRED, 'Path where should be located the generated features and fixtures');
60
+                ->setDescription('Create a snapshot of your schema to compare using behat tests.')
61
+                ->addOption('endpoint', null, InputOption::VALUE_REQUIRED, 'Name of the endpoint to export', DefinitionRegistry::DEFAULT_ENDPOINT)
62
+                ->addOption('all', 'a', InputOption::VALUE_NONE, 'Create snapshot for all registered endpoints')
63
+                ->addOption('strict', null, InputOption::VALUE_NONE, 'When use strict mode the snapshot must be updated every time your schema change')
64
+                ->addOption('features', null, InputOption::VALUE_REQUIRED, 'Path where should be located the generated features and fixtures');
65 65
     }
66 66
 
67 67
     /**
Please login to merge, or discard this patch.
src/Behat/Client/GraphQLClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
     public function sendRequest($method, $uri, array $parameters = [], array $files = [], array $server = [], $content = null, $changeHistory = true)
240 240
     {
241 241
         set_error_handler(
242
-            function ($level, $message, $errFile, $errLine) {
242
+            function($level, $message, $errFile, $errLine) {
243 243
                 if ($this->deprecationAdviser) {
244 244
                     $this->deprecationAdviser->addWarning($message, $errFile, $errLine);
245 245
                 }
Please login to merge, or discard this patch.
src/DependencyInjection/Configuration.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             ->beforeNormalization()
75 75
             ->ifString()
76 76
             ->then(
77
-                function ($v) {
77
+                function($v) {
78 78
                     return [$v];
79 79
                 }
80 80
             )
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
             ->beforeNormalization()
88 88
             ->ifString()
89 89
             ->then(
90
-                function ($v) {
90
+                function($v) {
91 91
                     return [$v];
92 92
                 }
93 93
             )
94 94
             ->end()
95 95
             ->validate()
96 96
             ->ifTrue(
97
-                function (array $value) {
97
+                function(array $value) {
98 98
                     foreach ($value as $val) {
99 99
                         try {
100 100
                             preg_match($val, null);
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
             ->beforeNormalization()
112 112
             ->ifString()
113 113
             ->then(
114
-                function ($v) {
114
+                function($v) {
115 115
                     return [$v];
116 116
                 }
117 117
             )
118 118
             ->end()
119 119
             ->validate()
120 120
             ->ifTrue(
121
-                function (array $value) {
121
+                function(array $value) {
122 122
                     foreach ($value as $val) {
123 123
                         try {
124 124
                             preg_match($val, null);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                           ->useAttributeAsKey('name')
137 137
                           ->validate()
138 138
                           ->ifTrue(
139
-                              function ($v) {
139
+                              function($v) {
140 140
                                   return array_key_exists('default', $v);
141 141
                               }
142 142
                           )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                   ->beforeNormalization()
149 149
                   ->ifString()
150 150
                   ->then(
151
-                      function ($v) {
151
+                      function($v) {
152 152
                           return preg_split('/\s*,\s*/', $v);
153 153
                       }
154 154
                   )
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
              ->beforeNormalization()
166 166
              ->ifString()
167 167
              ->then(
168
-                 function ($v) {
168
+                 function($v) {
169 169
                      return preg_split('/\s*,\s*/', $v);
170 170
                  }
171 171
              )
Please login to merge, or discard this patch.
Indentation   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -48,30 +48,30 @@  discard block
 block discarded – undo
48 48
     protected function configureErrorHandling(NodeBuilder $root)
49 49
     {
50 50
         $errorHandling = $root->arrayNode('error_handling')
51
-                              ->info('It is important to handle errors and when possible, report these errors back to your users for information. ')
52
-                              ->addDefaultsIfNotSet()
53
-                              ->children();
51
+                                ->info('It is important to handle errors and when possible, report these errors back to your users for information. ')
52
+                                ->addDefaultsIfNotSet()
53
+                                ->children();
54 54
 
55 55
         $errorHandling->enumNode('validation_messages')
56
-                      ->values(['error', 'payload', 'both'])
57
-                      ->info('Where should be displayed validation messages.')
58
-                      ->defaultValue('error');
56
+                        ->values(['error', 'payload', 'both'])
57
+                        ->info('Where should be displayed validation messages.')
58
+                        ->defaultValue('error');
59 59
 
60 60
         //@deprecated since v1.1 snd should be deleted in 2.0, this is a compatibility flag
61 61
         $errorHandling->booleanNode('jwt_auth_failure_compatibility')
62
-                      ->info('Keep BC with oldest version of JWT Authentication errors')
63
-                      ->setDeprecated('Since v1.1 and will will be removed in the next mayor release')
64
-                      ->defaultFalse();
62
+                        ->info('Keep BC with oldest version of JWT Authentication errors')
63
+                        ->setDeprecated('Since v1.1 and will will be removed in the next mayor release')
64
+                        ->defaultFalse();
65 65
 
66 66
         $errorHandling->booleanNode('show_trace')->info('Show error trace in debug mode')->defaultFalse();
67 67
 
68 68
         $errorHandling->scalarNode('formatter')
69
-                      ->info('Formatter is responsible for converting instances of Error to an array')
70
-                      ->defaultValue(DefaultErrorFormatter::class);
69
+                        ->info('Formatter is responsible for converting instances of Error to an array')
70
+                        ->defaultValue(DefaultErrorFormatter::class);
71 71
 
72 72
         $errorHandling->scalarNode('handler')
73
-                      ->info('Handler is useful for error filtering and logging.')
74
-                      ->defaultValue(DefaultErrorHandler::class);
73
+                        ->info('Handler is useful for error filtering and logging.')
74
+                        ->defaultValue(DefaultErrorHandler::class);
75 75
 
76 76
         $controlledErrors = $errorHandling
77 77
             ->arrayNode('controlled_errors')
@@ -157,44 +157,44 @@  discard block
 block discarded – undo
157 157
     protected function configureEndpoints(NodeBuilder $root)
158 158
     {
159 159
         $endpoints = $root->arrayNode('endpoints')
160
-                          ->useAttributeAsKey('name')
161
-                          ->validate()
162
-                          ->ifTrue(
163
-                              function ($v) {
164
-                                  return array_key_exists('default', $v);
165
-                              }
166
-                          )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
167
-                          ->end()
168
-                          ->arrayPrototype()
169
-                          ->children();
160
+                            ->useAttributeAsKey('name')
161
+                            ->validate()
162
+                            ->ifTrue(
163
+                                function ($v) {
164
+                                    return array_key_exists('default', $v);
165
+                                }
166
+                            )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
167
+                            ->end()
168
+                            ->arrayPrototype()
169
+                            ->children();
170 170
 
171 171
         $endpoints->arrayNode('roles')
172
-                  ->beforeNormalization()
173
-                  ->ifString()
174
-                  ->then(
175
-                      function ($v) {
176
-                          return preg_split('/\s*,\s*/', $v);
177
-                      }
178
-                  )
179
-                  ->end()
180
-                  ->prototype('scalar')
181
-                  ->end();
172
+                    ->beforeNormalization()
173
+                    ->ifString()
174
+                    ->then(
175
+                        function ($v) {
176
+                            return preg_split('/\s*,\s*/', $v);
177
+                        }
178
+                    )
179
+                    ->end()
180
+                    ->prototype('scalar')
181
+                    ->end();
182 182
 
183 183
         $endpoints->scalarNode('host')->example('^api\.backend\.');
184 184
         $endpoints->scalarNode('path')->example('/backend');
185 185
 
186 186
         $root->arrayNode('endpoint_alias')
187
-             ->info('Use alias to refer to multiple endpoints using only one name')
188
-             ->useAttributeAsKey('name')
189
-             ->beforeNormalization()
190
-             ->ifString()
191
-             ->then(
192
-                 function ($v) {
193
-                     return preg_split('/\s*,\s*/', $v);
194
-                 }
195
-             )
196
-             ->end()
197
-             ->variablePrototype();
187
+                ->info('Use alias to refer to multiple endpoints using only one name')
188
+                ->useAttributeAsKey('name')
189
+                ->beforeNormalization()
190
+                ->ifString()
191
+                ->then(
192
+                    function ($v) {
193
+                        return preg_split('/\s*,\s*/', $v);
194
+                    }
195
+                )
196
+                ->end()
197
+                ->variablePrototype();
198 198
 
199 199
         $root->scalarNode('endpoint_default')->info('Endpoint to apply to all definitions without explicit endpoint.');
200 200
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         $graphiql = $root->arrayNode('graphiql')->addDefaultsIfNotSet()->children();
206 206
 
207 207
         $graphiql->scalarNode('title')
208
-                 ->defaultValue('GraphQL API Explorer');
208
+                    ->defaultValue('GraphQL API Explorer');
209 209
 
210 210
         $graphiql
211 211
             ->scalarNode('data_warning_message')
@@ -233,61 +233,61 @@  discard block
 block discarded – undo
233 233
             ->defaultFalse();
234 234
 
235 235
         $authentication->scalarNode('login_message')
236
-                       ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
236
+                        ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
237 237
 
238 238
         $authenticationProvider = $authentication->arrayNode('provider')->children();
239 239
 
240 240
         //the updated version of `jwt` to use lexik authentication bundle
241 241
         $lexikJwt = $authenticationProvider->arrayNode('lexik_jwt')
242
-                                           ->canBeEnabled()
243
-                                           ->children();
242
+                                            ->canBeEnabled()
243
+                                            ->children();
244 244
 
245 245
         $lexikJwt->scalarNode('user_provider')
246
-                 ->isRequired()
247
-                 ->info('Name of the user provider to use');
246
+                    ->isRequired()
247
+                    ->info('Name of the user provider to use');
248 248
 
249 249
         $lexikJwt->scalarNode('username_label')
250
-                 ->defaultValue('Username');
250
+                    ->defaultValue('Username');
251 251
 
252 252
         $lexikJwt->scalarNode('password_label')
253
-                 ->defaultValue('Password');
253
+                    ->defaultValue('Password');
254 254
 
255 255
         $authenticationProvider->scalarNode('custom')
256
-                               ->defaultNull()
257
-                               ->info('Configure custom service to use as authentication provider');
256
+                                ->defaultNull()
257
+                                ->info('Configure custom service to use as authentication provider');
258 258
 
259 259
         //deprecated since v1.1 and should be deleted in v2.0
260 260
         $jwt = $authenticationProvider->arrayNode('jwt')
261
-                                      ->setDeprecated('Use lexik_jwt instead, this provider will be removed in the next mayor release.')
262
-                                      ->canBeEnabled()
263
-                                      ->children();
261
+                                        ->setDeprecated('Use lexik_jwt instead, this provider will be removed in the next mayor release.')
262
+                                        ->canBeEnabled()
263
+                                        ->children();
264 264
 
265 265
         $jwtLogin = $jwt->arrayNode('login')->children();
266 266
 
267 267
         $jwtLogin->scalarNode('url')
268
-                 ->info('Route name or URI to make the login process to retrieve the token.')
269
-                 ->isRequired();
268
+                    ->info('Route name or URI to make the login process to retrieve the token.')
269
+                    ->isRequired();
270 270
 
271 271
         $jwtLogin->scalarNode('username_parameter')
272
-                 ->defaultValue('username');
272
+                    ->defaultValue('username');
273 273
 
274 274
         $jwtLogin->scalarNode('username_label')
275
-                 ->defaultValue('Username');
275
+                    ->defaultValue('Username');
276 276
 
277 277
         $jwtLogin->scalarNode('password_parameter')
278
-                 ->defaultValue('password');
278
+                    ->defaultValue('password');
279 279
 
280 280
         $jwtLogin->scalarNode('password_label')
281
-                 ->defaultValue('Password');
281
+                    ->defaultValue('Password');
282 282
 
283 283
         $jwtLogin->enumNode('parameters_in')
284
-                 ->values(['form', 'query', 'header'])
285
-                 ->info('How pass parameters to request the token')
286
-                 ->defaultValue('form');
284
+                    ->values(['form', 'query', 'header'])
285
+                    ->info('How pass parameters to request the token')
286
+                    ->defaultValue('form');
287 287
 
288 288
         $jwtLogin->scalarNode('response_token_path')
289
-                 ->defaultValue('token')
290
-                 ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
289
+                    ->defaultValue('token')
290
+                    ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
291 291
 
292 292
         $jwtRequests = $jwt->arrayNode('requests')->addDefaultsIfNotSet()->children();
293 293
 
@@ -326,25 +326,25 @@  discard block
 block discarded – undo
326 326
     {
327 327
         $pagination = $root->arrayNode('pagination')->addDefaultsIfNotSet()->children();
328 328
         $pagination->integerNode('limit')
329
-                   ->defaultValue(100)->info('Maximum limit allowed for all paginations');
329
+                    ->defaultValue(100)->info('Maximum limit allowed for all paginations');
330 330
     }
331 331
 
332 332
     protected function configurePluginNamespaceGlobalConfig(NodeBuilder $root)
333 333
     {
334 334
         $namespaces = $root->arrayNode('namespaces')
335
-                           ->info(
336
-                               'Group GraphQL schema using namespaced schemas. 
335
+                            ->info(
336
+                                'Group GraphQL schema using namespaced schemas. 
337 337
 On large schemas is  helpful to keep schemas grouped by bundle and node'
338
-                           )
339
-                           ->canBeEnabled()
340
-                           ->addDefaultsIfNotSet()
341
-                           ->children();
338
+                            )
339
+                            ->canBeEnabled()
340
+                            ->addDefaultsIfNotSet()
341
+                            ->children();
342 342
 
343 343
         $bundles = $namespaces->arrayNode('bundles')
344
-                              ->info('Group each bundle into a separate schema definition')
345
-                              ->canBeDisabled()
346
-                              ->addDefaultsIfNotSet()
347
-                              ->children();
344
+                                ->info('Group each bundle into a separate schema definition')
345
+                                ->canBeDisabled()
346
+                                ->addDefaultsIfNotSet()
347
+                                ->children();
348 348
 
349 349
         $bundles->scalarNode('query_suffix')
350 350
                 ->info('The following suffix will be used for bundle query groups')
@@ -375,25 +375,25 @@  discard block
 block discarded – undo
375 375
                             ->children();
376 376
 
377 377
         $nodes->scalarNode('query_suffix')
378
-              ->info('The following suffix will be used to create the name for queries to the same node')
379
-              ->defaultValue('Query');
378
+                ->info('The following suffix will be used to create the name for queries to the same node')
379
+                ->defaultValue('Query');
380 380
 
381 381
         $nodes->scalarNode('mutation_suffix')
382
-              ->info('The following suffix will be used to create the name for mutations to the same node')
383
-              ->defaultValue('Mutation');
382
+                ->info('The following suffix will be used to create the name for mutations to the same node')
383
+                ->defaultValue('Mutation');
384 384
 
385 385
         $nodes->variableNode('ignore')
386
-              ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
387
-              ->defaultValue(['Node']);
386
+                ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
387
+                ->defaultValue(['Node']);
388 388
 
389 389
         $nodes->arrayNode('aliases')
390
-              ->info(
391
-                  'Define aliases for nodes to set definitions inside other desired node name. 
390
+                ->info(
391
+                    'Define aliases for nodes to set definitions inside other desired node name. 
392 392
 Can be used to group multiple nodes or publish a node with a different group name'
393
-              )
394
-              ->example('InvoiceItem: Invoice')
395
-              ->useAttributeAsKey('name')
396
-              ->prototype('scalar');
393
+                )
394
+                ->example('InvoiceItem: Invoice')
395
+                ->useAttributeAsKey('name')
396
+                ->prototype('scalar');
397 397
     }
398 398
 
399 399
     private function configureSecurity(NodeBuilder $rootNode)
@@ -439,13 +439,13 @@  discard block
 block discarded – undo
439 439
             ->children();
440 440
 
441 441
         $bcNode->variableNode('filters')
442
-               ->info('Keep deprecated "filters" argument in collections')
443
-               ->setDeprecated('v1.2')
444
-               ->defaultFalse();
442
+                ->info('Keep deprecated "filters" argument in collections')
443
+                ->setDeprecated('v1.2')
444
+                ->defaultFalse();
445 445
 
446 446
         $bcNode->variableNode('orderBy')
447
-               ->info('Keep deprecated "orderBy" argument in collections')
448
-               ->setDeprecated('v1.2')
449
-               ->defaultFalse();
447
+                ->info('Keep deprecated "orderBy" argument in collections')
448
+                ->setDeprecated('v1.2')
449
+                ->defaultFalse();
450 450
     }
451 451
 }
Please login to merge, or discard this patch.
src/Error/Exporter/MarkdownTableExporter.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@
 block discarded – undo
46 46
 
47 47
         $styleGuide = new TableStyle();
48 48
         $styleGuide->setHorizontalBorderChar('')
49
-                   ->setVerticalBorderChar('|')
50
-                   ->setCrossingChar(' ')
51
-                   ->setCellHeaderFormat('%s');
49
+                    ->setVerticalBorderChar('|')
50
+                    ->setCrossingChar(' ')
51
+                    ->setCellHeaderFormat('%s');
52 52
 
53 53
         $table->setStyle($styleGuide);
54 54
         $table->setRows($rows);
Please login to merge, or discard this patch.
src/Error/Exporter/ConsoleTableExporter.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 
36 36
         $table = new Table($output);
37 37
         $table->setHeaders(['Code', 'Text', 'Description'])
38
-              ->setRows($rows);
38
+                ->setRows($rows);
39 39
         $table->render();
40 40
     }
41 41
 }
Please login to merge, or discard this patch.