symfony-storage/StorageBundle/DependencyInjection/Configuration.php

41 lines
1.5 KiB
PHP
Raw Normal View History

2019-02-20 11:24:22 +01:00
<?php
namespace Bluesquare\StorageBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
/**
* Generates the configuration tree builder.
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$root = $treeBuilder->root('storage');
2019-02-20 11:54:31 +01:00
$root->useAttributeAsKey('storage_name')
2019-02-20 11:56:20 +01:00
->prototype('array')
2019-02-20 11:56:34 +01:00
->children()
2019-02-20 12:44:23 +01:00
->scalarNode('type')->isRequired()->cannotBeEmpty()->end()
->scalarNode('bucket')->isRequired()->cannotBeEmpty()->end()
->scalarNode('region')->isRequired()->cannotBeEmpty()->end()
->scalarNode('endpoint')->isRequired()->cannotBeEmpty()->end()
2019-02-20 12:44:52 +01:00
->arrayNode('credentials')
2019-02-20 11:59:30 +01:00
->children()
2019-02-20 12:44:23 +01:00
->scalarNode('key')->isRequired()->cannotBeEmpty()->end()
->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()
2019-02-20 11:59:30 +01:00
->end()
->end()
->scalarNode('version')->end()
->scalarNode('path')->end()
2019-02-20 11:56:34 +01:00
->end()
2019-02-20 11:40:36 +01:00
->end()
->end();
2019-02-20 11:24:22 +01:00
return ($treeBuilder);
}
}