for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nicofuma\SwaggerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This class contains the configuration information for the bundle.
*
* This information is solely responsible for how the different configuration
* sections are normalized, and merged.
*/
class Configuration implements ConfigurationInterface
{
* {@inheritdoc}
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('nicofuma_swagger', 'array');
$rootNode
->fixXmlConfig('definition')
->children()
->arrayNode('definitions')
->prototype('array')
->arrayNode('pattern')
->beforeNormalization()->ifString()->then(function ($v) {
return ['path' => $v];
})->end()
->fixXmlConfig('ip')
->fixXmlConfig('method')
->scalarNode('path')
->defaultNull()
->info('use the urldecoded format')
->example('^/path to resource/')
->end()
->scalarNode('host')->defaultNull()->end()
->arrayNode('ips')
return [$v];
->prototype('scalar')->end()
->arrayNode('methods')
return preg_split('/\s*,\s*/', $v);
->scalarNode('swagger_file')->end()
->booleanNode('strict')->defaultTrue()->end()
;
return $treeBuilder;
}