| @@ -42,44 +42,44 @@ discard block | ||
| 42 | 42 | protected function configureEndpoints(NodeBuilder $root) | 
| 43 | 43 |      { | 
| 44 | 44 |          $endpoints = $root->arrayNode('endpoints') | 
| 45 | -                          ->useAttributeAsKey('name') | |
| 46 | - ->validate() | |
| 47 | - ->ifTrue( | |
| 48 | -                              function ($v) { | |
| 49 | -                                  return array_key_exists('default', $v); | |
| 50 | - } | |
| 51 | -                          )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.') | |
| 52 | - ->end() | |
| 53 | - ->arrayPrototype() | |
| 54 | - ->children(); | |
| 45 | +                            ->useAttributeAsKey('name') | |
| 46 | + ->validate() | |
| 47 | + ->ifTrue( | |
| 48 | +                                function ($v) { | |
| 49 | +                                    return array_key_exists('default', $v); | |
| 50 | + } | |
| 51 | +                            )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.') | |
| 52 | + ->end() | |
| 53 | + ->arrayPrototype() | |
| 54 | + ->children(); | |
| 55 | 55 | |
| 56 | 56 |          $endpoints->arrayNode('roles') | 
| 57 | - ->beforeNormalization() | |
| 58 | - ->ifString() | |
| 59 | - ->then( | |
| 60 | -                      function ($v) { | |
| 61 | -                          return preg_split('/\s*,\s*/', $v); | |
| 62 | - } | |
| 63 | - ) | |
| 64 | - ->end() | |
| 65 | -                  ->prototype('scalar') | |
| 66 | - ->end(); | |
| 57 | + ->beforeNormalization() | |
| 58 | + ->ifString() | |
| 59 | + ->then( | |
| 60 | +                        function ($v) { | |
| 61 | +                            return preg_split('/\s*,\s*/', $v); | |
| 62 | + } | |
| 63 | + ) | |
| 64 | + ->end() | |
| 65 | +                    ->prototype('scalar') | |
| 66 | + ->end(); | |
| 67 | 67 | |
| 68 | 68 |          $endpoints->scalarNode('host')->example('^api\.backend\.'); | 
| 69 | 69 |          $endpoints->scalarNode('path')->example('/backend'); | 
| 70 | 70 | |
| 71 | 71 |          $root->arrayNode('endpoint_alias') | 
| 72 | -             ->info('Use alias to refer to multiple endpoints using only one name') | |
| 73 | -             ->useAttributeAsKey('name') | |
| 74 | - ->beforeNormalization() | |
| 75 | - ->ifString() | |
| 76 | - ->then( | |
| 77 | -                 function ($v) { | |
| 78 | -                     return preg_split('/\s*,\s*/', $v); | |
| 79 | - } | |
| 80 | - ) | |
| 81 | - ->end() | |
| 82 | - ->variablePrototype(); | |
| 72 | +                ->info('Use alias to refer to multiple endpoints using only one name') | |
| 73 | +                ->useAttributeAsKey('name') | |
| 74 | + ->beforeNormalization() | |
| 75 | + ->ifString() | |
| 76 | + ->then( | |
| 77 | +                    function ($v) { | |
| 78 | +                        return preg_split('/\s*,\s*/', $v); | |
| 79 | + } | |
| 80 | + ) | |
| 81 | + ->end() | |
| 82 | + ->variablePrototype(); | |
| 83 | 83 | |
| 84 | 84 |          $root->scalarNode('endpoint_default')->info('Endpoint to apply to all definitions without explicit endpoint.'); | 
| 85 | 85 | |
| @@ -90,7 +90,7 @@ discard block | ||
| 90 | 90 |          $graphiql = $root->arrayNode('graphiql')->addDefaultsIfNotSet()->children(); | 
| 91 | 91 | |
| 92 | 92 |          $graphiql->scalarNode('title') | 
| 93 | -                 ->defaultValue('GraphQL API Explorer'); | |
| 93 | +                    ->defaultValue('GraphQL API Explorer'); | |
| 94 | 94 | |
| 95 | 95 | $graphiql | 
| 96 | 96 |              ->scalarNode('data_warning_message') | 
| @@ -99,7 +99,7 @@ discard block | ||
| 99 | 99 |          $graphiql->enumNode('data_warning_style')->values(['info', 'warning', 'danger'])->defaultValue('danger'); | 
| 100 | 100 | |
| 101 | 101 |          $graphiql->scalarNode('template') | 
| 102 | -                 ->defaultValue('@YnloGraphQL/explorer.html.twig'); | |
| 102 | +                    ->defaultValue('@YnloGraphQL/explorer.html.twig'); | |
| 103 | 103 | |
| 104 | 104 |          $authentication = $graphiql->arrayNode('authentication')->addDefaultsIfNotSet()->children(); | 
| 105 | 105 | $authentication | 
| @@ -111,7 +111,7 @@ discard block | ||
| 111 | 111 | ->defaultFalse(); | 
| 112 | 112 | |
| 113 | 113 |          $authentication->scalarNode('login_message') | 
| 114 | -                       ->defaultValue('Start exploring GraphQL API queries using your account’s data now.'); | |
| 114 | +                        ->defaultValue('Start exploring GraphQL API queries using your account’s data now.'); | |
| 115 | 115 | |
| 116 | 116 |          $authenticationProvider = $authentication->arrayNode('provider')->children(); | 
| 117 | 117 | |
| @@ -120,29 +120,29 @@ discard block | ||
| 120 | 120 |          $jwtLogin = $jwt->arrayNode('login')->children(); | 
| 121 | 121 | |
| 122 | 122 |          $jwtLogin->scalarNode('url') | 
| 123 | -                 ->info('Route name or URI to make the login process to retrieve the token.') | |
| 124 | - ->isRequired(); | |
| 123 | +                    ->info('Route name or URI to make the login process to retrieve the token.') | |
| 124 | + ->isRequired(); | |
| 125 | 125 | |
| 126 | 126 |          $jwtLogin->scalarNode('username_parameter') | 
| 127 | -                 ->defaultValue('username'); | |
| 127 | +                    ->defaultValue('username'); | |
| 128 | 128 | |
| 129 | 129 |          $jwtLogin->scalarNode('username_label') | 
| 130 | -                 ->defaultValue('Username'); | |
| 130 | +                    ->defaultValue('Username'); | |
| 131 | 131 | |
| 132 | 132 |          $jwtLogin->scalarNode('password_parameter') | 
| 133 | -                 ->defaultValue('password'); | |
| 133 | +                    ->defaultValue('password'); | |
| 134 | 134 | |
| 135 | 135 |          $jwtLogin->scalarNode('password_label') | 
| 136 | -                 ->defaultValue('Password'); | |
| 136 | +                    ->defaultValue('Password'); | |
| 137 | 137 | |
| 138 | 138 |          $jwtLogin->enumNode('parameters_in') | 
| 139 | - ->values(['form', 'query', 'header']) | |
| 140 | -                 ->info('How pass parameters to request the token') | |
| 141 | -                 ->defaultValue('form'); | |
| 139 | + ->values(['form', 'query', 'header']) | |
| 140 | +                    ->info('How pass parameters to request the token') | |
| 141 | +                    ->defaultValue('form'); | |
| 142 | 142 | |
| 143 | 143 |          $jwtLogin->scalarNode('response_token_path') | 
| 144 | -                 ->defaultValue('token') | |
| 145 | -                 ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.'); | |
| 144 | +                    ->defaultValue('token') | |
| 145 | +                    ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.'); | |
| 146 | 146 | |
| 147 | 147 |          $jwtRequests = $jwt->arrayNode('requests')->addDefaultsIfNotSet()->children(); | 
| 148 | 148 | |
| @@ -160,8 +160,8 @@ discard block | ||
| 160 | 160 |                      ->info('Customize how the token should be send,  use the place holder {token} to replace for current token'); | 
| 161 | 161 | |
| 162 | 162 |          $authenticationProvider->scalarNode('custom') | 
| 163 | - ->defaultNull() | |
| 164 | -                               ->info('Configure custom service to use as authentication provider'); | |
| 163 | + ->defaultNull() | |
| 164 | +                                ->info('Configure custom service to use as authentication provider'); | |
| 165 | 165 | } | 
| 166 | 166 | |
| 167 | 167 | protected function configureCORS(NodeBuilder $root) | 
| @@ -187,25 +187,25 @@ discard block | ||
| 187 | 187 |      { | 
| 188 | 188 |          $pagination = $root->arrayNode('pagination')->addDefaultsIfNotSet()->children(); | 
| 189 | 189 |          $pagination->integerNode('limit') | 
| 190 | -                   ->defaultValue(100)->info('Maximum limit allowed for all paginations'); | |
| 190 | +                    ->defaultValue(100)->info('Maximum limit allowed for all paginations'); | |
| 191 | 191 | } | 
| 192 | 192 | |
| 193 | 193 | protected function configurePluginNamespaceGlobalConfig(NodeBuilder $root) | 
| 194 | 194 |      { | 
| 195 | 195 |          $namespaces = $root->arrayNode('namespaces') | 
| 196 | - ->info( | |
| 197 | - 'Group GraphQL schema using namespaced schemas. | |
| 196 | + ->info( | |
| 197 | + 'Group GraphQL schema using namespaced schemas. | |
| 198 | 198 | On large schemas is helpful to keep schemas grouped by bundle and node' | 
| 199 | - ) | |
| 200 | - ->canBeEnabled() | |
| 201 | - ->addDefaultsIfNotSet() | |
| 202 | - ->children(); | |
| 199 | + ) | |
| 200 | + ->canBeEnabled() | |
| 201 | + ->addDefaultsIfNotSet() | |
| 202 | + ->children(); | |
| 203 | 203 | |
| 204 | 204 |          $bundles = $namespaces->arrayNode('bundles') | 
| 205 | -                              ->info('Group each bundle into a separate schema definition') | |
| 206 | - ->canBeDisabled() | |
| 207 | - ->addDefaultsIfNotSet() | |
| 208 | - ->children(); | |
| 205 | +                                ->info('Group each bundle into a separate schema definition') | |
| 206 | + ->canBeDisabled() | |
| 207 | + ->addDefaultsIfNotSet() | |
| 208 | + ->children(); | |
| 209 | 209 | |
| 210 | 210 |          $bundles->scalarNode('query_suffix') | 
| 211 | 211 |                  ->info('The following suffix will be used for bundle query groups') | 
| @@ -236,25 +236,25 @@ discard block | ||
| 236 | 236 | ->children(); | 
| 237 | 237 | |
| 238 | 238 |          $nodes->scalarNode('query_suffix') | 
| 239 | -              ->info('The following suffix will be used to create the name for queries to the same node') | |
| 240 | -              ->defaultValue('Query'); | |
| 239 | +                ->info('The following suffix will be used to create the name for queries to the same node') | |
| 240 | +                ->defaultValue('Query'); | |
| 241 | 241 | |
| 242 | 242 |          $nodes->scalarNode('mutation_suffix') | 
| 243 | -              ->info('The following suffix will be used to create the name for mutations to the same node') | |
| 244 | -              ->defaultValue('Mutation'); | |
| 243 | +                ->info('The following suffix will be used to create the name for mutations to the same node') | |
| 244 | +                ->defaultValue('Mutation'); | |
| 245 | 245 | |
| 246 | 246 |          $nodes->variableNode('ignore') | 
| 247 | -              ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation') | |
| 248 | - ->defaultValue(['Node']); | |
| 247 | +                ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation') | |
| 248 | + ->defaultValue(['Node']); | |
| 249 | 249 | |
| 250 | 250 |          $nodes->arrayNode('aliases') | 
| 251 | - ->info( | |
| 252 | - 'Define aliases for nodes to set definitions inside other desired node name. | |
| 251 | + ->info( | |
| 252 | + 'Define aliases for nodes to set definitions inside other desired node name. | |
| 253 | 253 | Can be used to group multiple nodes or publish a node with a different group name' | 
| 254 | - ) | |
| 255 | -              ->example('InvoiceItem: Invoice') | |
| 256 | -              ->useAttributeAsKey('name') | |
| 257 | -              ->prototype('scalar'); | |
| 254 | + ) | |
| 255 | +                ->example('InvoiceItem: Invoice') | |
| 256 | +                ->useAttributeAsKey('name') | |
| 257 | +                ->prototype('scalar'); | |
| 258 | 258 | } | 
| 259 | 259 | |
| 260 | 260 | private function configureSecurity(NodeBuilder $rootNode) | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 |                            ->useAttributeAsKey('name') | 
| 46 | 46 | ->validate() | 
| 47 | 47 | ->ifTrue( | 
| 48 | -                              function ($v) { | |
| 48 | +                              function($v) { | |
| 49 | 49 |                                    return array_key_exists('default', $v); | 
| 50 | 50 | } | 
| 51 | 51 |                            )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.') | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | ->beforeNormalization() | 
| 58 | 58 | ->ifString() | 
| 59 | 59 | ->then( | 
| 60 | -                      function ($v) { | |
| 60 | +                      function($v) { | |
| 61 | 61 |                            return preg_split('/\s*,\s*/', $v); | 
| 62 | 62 | } | 
| 63 | 63 | ) | 
| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 | ->beforeNormalization() | 
| 75 | 75 | ->ifString() | 
| 76 | 76 | ->then( | 
| 77 | -                 function ($v) { | |
| 77 | +                 function($v) { | |
| 78 | 78 |                       return preg_split('/\s*,\s*/', $v); | 
| 79 | 79 | } | 
| 80 | 80 | ) | 
| @@ -102,9 +102,9 @@ | ||
| 102 | 102 | } | 
| 103 | 103 | |
| 104 | 104 | $files = Finder::create() | 
| 105 | - ->in($dirs[1]) | |
| 106 | -                       ->date(sprintf('>= %s', date('Y-m-d H:i:s', $controlTime))) | |
| 107 | - ->files(); | |
| 105 | + ->in($dirs[1]) | |
| 106 | +                        ->date(sprintf('>= %s', date('Y-m-d H:i:s', $controlTime))) | |
| 107 | + ->files(); | |
| 108 | 108 | |
| 109 | 109 | //exist at least one modified file | 
| 110 | 110 |          foreach ($files as $file) { | 
| @@ -76,16 +76,16 @@ | ||
| 76 | 76 | ->defaultValue(FosUserResolver::class); | 
| 77 | 77 | |
| 78 | 78 |          $jwt->arrayNode('users') | 
| 79 | - ->beforeNormalization() | |
| 80 | - ->ifString() | |
| 81 | - ->then( | |
| 82 | -                      function ($v) { | |
| 83 | -                          return preg_split('/\s*,\s*/', $v); | |
| 84 | - } | |
| 85 | - ) | |
| 86 | - ->end() | |
| 87 | -                  ->prototype('scalar') | |
| 88 | - ->end(); | |
| 79 | + ->beforeNormalization() | |
| 80 | + ->ifString() | |
| 81 | + ->then( | |
| 82 | +                        function ($v) { | |
| 83 | +                            return preg_split('/\s*,\s*/', $v); | |
| 84 | + } | |
| 85 | + ) | |
| 86 | + ->end() | |
| 87 | +                    ->prototype('scalar') | |
| 88 | + ->end(); | |
| 89 | 89 | } | 
| 90 | 90 | |
| 91 | 91 | public function process(ContainerBuilder $container) | 
| @@ -42,7 +42,7 @@ discard block | ||
| 42 | 42 | */ | 
| 43 | 43 | public function __construct(ServiceProcessor $processor = null) | 
| 44 | 44 |      { | 
| 45 | - $this->processor = $processor ? : new ServiceProcessor(); | |
| 45 | + $this->processor = $processor ?: new ServiceProcessor(); | |
| 46 | 46 | } | 
| 47 | 47 | |
| 48 | 48 | public function getConfigKey() | 
| @@ -79,7 +79,7 @@ discard block | ||
| 79 | 79 | ->beforeNormalization() | 
| 80 | 80 | ->ifString() | 
| 81 | 81 | ->then( | 
| 82 | -                      function ($v) { | |
| 82 | +                      function($v) { | |
| 83 | 83 |                            return preg_split('/\s*,\s*/', $v); | 
| 84 | 84 | } | 
| 85 | 85 | ) | 
| @@ -38,13 +38,13 @@ discard block | ||
| 38 | 38 | [ | 
| 39 | 39 | 'name' => $definition->getName(), | 
| 40 | 40 | 'description' => $definition->getDescription(), | 
| 41 | -                'fields' => function () { | |
| 41 | +                'fields' => function() { | |
| 42 | 42 | return $this->resolveFields(); | 
| 43 | 43 | }, | 
| 44 | -                'interfaces' => function () { | |
| 44 | +                'interfaces' => function() { | |
| 45 | 45 | return $this->resolveInterfaces(); | 
| 46 | 46 | }, | 
| 47 | -                'resolveField' => function ($root, array $args, $context, ResolveInfo $resolveInfo) { | |
| 47 | +                'resolveField' => function($root, array $args, $context, ResolveInfo $resolveInfo) { | |
| 48 | 48 | $resolver = new ObjectFieldResolver( | 
| 49 | 49 | $this->container, | 
| 50 | 50 | $this->endpoint, | 
| @@ -55,7 +55,7 @@ discard block | ||
| 55 | 55 | |
| 56 | 56 | return $resolver($root, $args, $context, $resolveInfo); | 
| 57 | 57 | }, | 
| 58 | -                'isTypeOf' => function ($value, $context, ResolveInfo $info) { | |
| 58 | +                'isTypeOf' => function($value, $context, ResolveInfo $info) { | |
| 59 | 59 | //TODO: implement this | 
| 60 | 60 | }, | 
| 61 | 61 | ] | 
| @@ -67,8 +67,8 @@ discard block | ||
| 67 | 67 | $fields = []; | 
| 68 | 68 |          foreach ($this->definition->getFields() as $fieldDefinition) { | 
| 69 | 69 |              try { | 
| 70 | -                if (!$fieldDefinition->getType()){ | |
| 71 | - print_r($fieldDefinition);exit; | |
| 70 | +                if (!$fieldDefinition->getType()) { | |
| 71 | + print_r($fieldDefinition); exit; | |
| 72 | 72 | } | 
| 73 | 73 | $type = TypeRegistry::get($fieldDefinition->getType()); | 
| 74 | 74 |              } catch (\UnexpectedValueException $exception) { | 
| @@ -43,7 +43,7 @@ discard block | ||
| 43 | 43 |          if ($formBuilder) { | 
| 44 | 44 | $formBuilder->addEventListener( | 
| 45 | 45 | FormEvents::SUBMIT, | 
| 46 | -                function (FormEvent $event) use (&$mutationEvent) { | |
| 46 | +                function(FormEvent $event) use (&$mutationEvent) { | |
| 47 | 47 |                      if ($this->eventDispatcher) { | 
| 48 | 48 | $mutationEvent = new GraphQLMutationEvent($this->context, $event); | 
| 49 | 49 | $this->eventDispatcher->dispatch(GraphQLEvents::MUTATION_SUBMITTED, $mutationEvent); | 
| @@ -53,8 +53,8 @@ discard block | ||
| 53 | 53 | |
| 54 | 54 | $formBuilder->addEventSubscriber($this); | 
| 55 | 55 | |
| 56 | -            $extensionExecutor = function ($method) { | |
| 57 | -                return function (FormEvent $event) use ($method) { | |
| 56 | +            $extensionExecutor = function($method) { | |
| 57 | +                return function(FormEvent $event) use ($method) { | |
| 58 | 58 |                      foreach ($this->extensions as $extension) { | 
| 59 | 59 | return call_user_func_array([$extension, $method], [$event]); | 
| 60 | 60 | } |