for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the xAPI package.
*
* (c) Christian Flothmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Xabbuh\XApi\Bundle\ClientBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* XApi client bundle configuration.
* @author Christian Flothmann <[email protected]>
class Configuration implements ConfigurationInterface
{
* {@inheritDoc}
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('xabbuh_xapi_client');
$rootNode
->fixXmlConfig('client')
->children()
->arrayNode('clients')
->useAttributeAsKey('name')
->prototype('array')
->scalarNode('base_url')->isRequired()->end()
->scalarNode('username')->end()
->scalarNode('password')->end()
->scalarNode('version')
->defaultValue('1.0.1')
->validate()
->ifNotInArray(array('1.0.0', '1.0.1'))
->thenInvalid('Version must be on of 1.0.0, 1.0.1')
->end()
->end();
return $treeBuilder;
}