We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 18 | class Configuration implements ConfigurationInterface |
||
| 19 | { |
||
| 20 | public const NAME = 'overblog_graphql'; |
||
| 21 | |||
| 22 | /** bool */ |
||
| 23 | private $debug; |
||
| 24 | |||
| 25 | /** null|string */ |
||
| 26 | private $cacheDir; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Constructor. |
||
| 30 | * |
||
| 31 | * @param bool $debug Whether to use the debug mode |
||
| 32 | * @param null|string $cacheDir |
||
| 33 | */ |
||
| 34 | 33 | public function __construct(bool $debug, string $cacheDir = null) |
|
| 39 | |||
| 40 | 33 | public function getConfigTreeBuilder() |
|
| 41 | { |
||
| 42 | 33 | $treeBuilder = new TreeBuilder(); |
|
| 43 | 33 | $rootNode = $treeBuilder->root(self::NAME); |
|
| 44 | |||
| 45 | $rootNode |
||
| 46 | 33 | ->children() |
|
| 47 | 33 | ->append($this->batchingMethodSection()) |
|
| 48 | 33 | ->append($this->definitionsSection()) |
|
| 49 | 33 | ->append($this->errorsHandlerSection()) |
|
| 50 | 33 | ->append($this->servicesSection()) |
|
| 51 | 33 | ->append($this->securitySection()) |
|
| 52 | 33 | ->append($this->doctrineSection()) |
|
| 53 | 33 | ->end(); |
|
| 54 | |||
| 55 | 33 | return $treeBuilder; |
|
| 56 | } |
||
| 57 | |||
| 58 | 33 | private function batchingMethodSection() |
|
| 59 | { |
||
| 60 | 33 | $builder = new TreeBuilder(); |
|
| 61 | /** @var EnumNodeDefinition $node */ |
||
| 62 | 33 | $node = $builder->root('batching_method', 'enum'); |
|
| 63 | |||
| 64 | $node |
||
| 65 | 33 | ->values(['relay', 'apollo']) |
|
| 66 | 33 | ->defaultValue('relay') |
|
| 67 | 33 | ->end(); |
|
| 68 | |||
| 69 | 33 | return $node; |
|
| 70 | } |
||
| 71 | |||
| 72 | 33 | private function errorsHandlerSection() |
|
| 73 | { |
||
| 74 | 33 | $builder = new TreeBuilder(); |
|
| 75 | /** @var ArrayNodeDefinition $node */ |
||
| 76 | 33 | $node = $builder->root('errors_handler'); |
|
| 77 | $node |
||
| 78 | 33 | ->treatFalseLike(['enabled' => false]) |
|
| 79 | 33 | ->treatTrueLike(['enabled' => true]) |
|
| 80 | 33 | ->treatNullLike(['enabled' => true]) |
|
| 81 | 33 | ->addDefaultsIfNotSet() |
|
| 82 | 33 | ->children() |
|
| 83 | 33 | ->booleanNode('enabled')->defaultTrue()->end() |
|
| 84 | 33 | ->scalarNode('internal_error_message')->defaultValue(ErrorHandler::DEFAULT_ERROR_MESSAGE)->end() |
|
| 85 | 33 | ->booleanNode('rethrow_internal_exceptions')->defaultFalse()->end() |
|
| 86 | 33 | ->booleanNode('debug')->defaultValue($this->debug)->end() |
|
| 87 | 33 | ->booleanNode('log')->defaultTrue()->end() |
|
| 88 | 33 | ->scalarNode('logger_service')->defaultValue(ErrorLoggerListener::DEFAULT_LOGGER_SERVICE)->end() |
|
| 89 | 33 | ->booleanNode('map_exceptions_to_parent')->defaultFalse()->end() |
|
| 90 | 33 | ->arrayNode('exceptions') |
|
| 91 | 33 | ->addDefaultsIfNotSet() |
|
| 92 | 33 | ->children() |
|
| 93 | 33 | ->arrayNode('warnings') |
|
| 94 | 33 | ->treatNullLike([]) |
|
| 95 | 33 | ->prototype('scalar')->end() |
|
| 96 | 33 | ->end() |
|
| 97 | 33 | ->arrayNode('errors') |
|
| 98 | 33 | ->treatNullLike([]) |
|
| 99 | 33 | ->prototype('scalar')->end() |
|
| 100 | 33 | ->end() |
|
| 101 | 33 | ->end() |
|
| 102 | 33 | ->end(); |
|
| 103 | |||
| 104 | 33 | return $node; |
|
| 105 | } |
||
| 106 | |||
| 107 | 33 | private function definitionsSection() |
|
| 108 | { |
||
| 109 | 33 | $builder = new TreeBuilder(); |
|
| 110 | /** @var ArrayNodeDefinition $node */ |
||
| 111 | 33 | $node = $builder->root('definitions'); |
|
| 112 | $node |
||
| 113 | 33 | ->addDefaultsIfNotSet() |
|
| 114 | 33 | ->children() |
|
| 115 | 33 | ->variableNode('default_resolver')->defaultValue([Resolver::class, 'defaultResolveFn'])->end() |
|
| 116 | 33 | ->scalarNode('class_namespace')->defaultValue('Overblog\\GraphQLBundle\\__DEFINITIONS__')->end() |
|
| 117 | 33 | ->scalarNode('cache_dir')->defaultNull()->end() |
|
| 118 | 33 | ->booleanNode('use_classloader_listener')->defaultTrue()->end() |
|
| 119 | 33 | ->booleanNode('auto_compile')->defaultTrue()->end() |
|
| 120 | 33 | ->booleanNode('show_debug_info')->info('Show some performance stats in extensions')->defaultFalse()->end() |
|
| 121 | 33 | ->booleanNode('config_validation')->defaultValue($this->debug)->end() |
|
| 122 | 33 | ->append($this->definitionsSchemaSection()) |
|
| 123 | 33 | ->append($this->definitionsMappingsSection()) |
|
| 124 | 33 | ->arrayNode('builders') |
|
| 125 | 33 | ->children() |
|
| 126 | 33 | ->append($this->builderSection('field')) |
|
| 127 | 33 | ->append($this->builderSection('args')) |
|
| 128 | 33 | ->end() |
|
| 129 | 33 | ->end() |
|
| 130 | |||
| 131 | 33 | ->end() |
|
| 132 | 33 | ->end(); |
|
| 133 | |||
| 134 | 33 | return $node; |
|
| 135 | } |
||
| 136 | |||
| 137 | 33 | private function servicesSection() |
|
| 160 | |||
| 161 | 33 | private function securitySection() |
|
| 178 | |||
| 179 | 33 | private function definitionsSchemaSection() |
|
| 214 | |||
| 215 | 33 | private function definitionsMappingsSection() |
|
| 216 | { |
||
| 217 | 33 | $builder = new TreeBuilder(); |
|
| 218 | 33 | $node = $builder->root('mappings'); |
|
| 263 | |||
| 264 | 33 | private function doctrineSection() |
|
| 280 | |||
| 281 | /** |
||
| 282 | * @param string $name |
||
| 283 | * |
||
| 284 | * @return ArrayNodeDefinition |
||
| 285 | */ |
||
| 286 | 33 | private function builderSection($name) |
|
| 319 | |||
| 320 | /** |
||
| 321 | * @param string $name |
||
| 322 | * @param bool $disabledValue |
||
| 323 | * |
||
| 324 | * @return ScalarNodeDefinition |
||
| 325 | */ |
||
| 326 | 33 | private function securityQuerySection($name, $disabledValue) |
|
| 361 | } |
||
| 362 |