for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the PHP Translation package.
*
* (c) PHP Translation team <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Translation\PlatformAdapter\Transifex\Bridge\Symfony\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* @author Tobias Nyholm <[email protected]>
class Configuration implements ConfigurationInterface
{
* {@inheritdoc}
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$root = $treeBuilder->root('translation_adapter_transifex');
$root->children()
->scalarNode('username')->isRequired()->cannotBeEmpty()->end()
->scalarNode('password')->isRequired()->cannotBeEmpty()->end()
->append($this->getProjectNode())
->end();
return $treeBuilder;
}
* @return \Symfony\Component\Config\Definition\Builder\NodeDefinition
private function getProjectNode()
$node = $treeBuilder->root('projects');
$node
->useAttributeAsKey('name')
->prototype('array')
->children()
->arrayNode('domains')
->requiresAtLeastOneElement()
->prototype('scalar')->end()
->end()
return $node;