for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
/*
* This file is part of the KleijnWeb\SwaggerBundle package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KleijnWeb\SwaggerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* @author John Kleijn <[email protected]>
class Configuration implements ConfigurationInterface
{
* {@inheritdoc}
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('swagger');
$rootNode
->children()
->scalarNode('validate_responses')->defaultFalse()
->end()
->arrayNode('hydrator')
->arrayNode('namespaces')->isRequired()
->beforeNormalization()
->ifString()
->then(function ($v) {
return [$v];
})
->prototype('scalar')
->arrayNode('document')
->addDefaultsIfNotSet()
->scalarNode('cache')->isRequired()->defaultFalse()->end()->scalarNode('base_path')->defaultValue('')->end()
->end();
return $treeBuilder;
}