Setono /
TinyPngBundle
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Setono\TinyPngBundle\DependencyInjection; |
||
| 6 | |||
| 7 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
||
| 8 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
||
| 9 | |||
| 10 | final class Configuration implements ConfigurationInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * {@inheritdoc} |
||
| 14 | */ |
||
| 15 | public function getConfigTreeBuilder(): TreeBuilder |
||
| 16 | { |
||
| 17 | $treeBuilder = new TreeBuilder(); |
||
| 18 | $rootNode = $treeBuilder->root('setono_tiny_png'); |
||
| 19 | $rootNode |
||
| 20 | ->addDefaultsIfNotSet() |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 21 | ->children() |
||
| 22 | ->scalarNode('api_key') |
||
| 23 | ->isRequired() |
||
| 24 | ->cannotBeEmpty() |
||
| 25 | ->info('Your TinyPNG API key') |
||
| 26 | ->end() |
||
| 27 | ->scalarNode('proxy') |
||
| 28 | ->defaultNull() |
||
| 29 | ->cannotBeEmpty() |
||
| 30 | ->info('The proxy to use') |
||
| 31 | ->end() |
||
| 32 | ->end() |
||
| 33 | ; |
||
| 34 | |||
| 35 | return $treeBuilder; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |