Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Implemented the ConfigurationInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jun 19, 2011
1 parent b4ec324 commit cc2d51a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
8 changes: 4 additions & 4 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
namespace Sensio\CasBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

class Configuration
class Configuration implements ConfigurationInterface
{
/**
* Generates the configuration tree.
*
* @return Symfony\Component\Config\Definition\NodeInterface
* @return TreeBuilder
*/
public function getConfigTree()
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();

Expand All @@ -24,7 +25,6 @@ public function getConfigTree()
->scalarNode('request')->defaultValue('curl')->end()
->end()
->end()
->buildTree()
;
}
}
9 changes: 1 addition & 8 deletions DependencyInjection/SensioCasExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration();

// add configuration
$tree = $configuration->getConfigTree();
$config = $processor->process($tree, $configs);
$config = $processor->processConfiguration($configuration, $configs);

foreach ($config as $key => $value) {
$container->setParameter('sensio_cas.'.$key, $value);
Expand All @@ -27,10 +26,4 @@ public function load(array $configs, ContainerBuilder $container)
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('cas.xml');
}

public function getAlias()
{
return 'sensio_cas';
}

}

0 comments on commit cc2d51a

Please sign in to comment.