Skip to content

Commit

Permalink
Add feature description in bundle configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jdecool committed Oct 17, 2016
1 parent fa237f8 commit dea9c00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ public function getConfigTreeBuilder()
->ifTrue(function($v) { return !is_array($v); })
->then(function($v) { return ['enabled' => (bool) $v]; })
->end()
->useAttributeAsKey('key')
->prototype('enum')->values([true, false])->end()
->children()
->scalarNode('description')->end()
->booleanNode('enabled')->isRequired()->end()
->end()
->end()
->end()
->end()
Expand Down
5 changes: 4 additions & 1 deletion Tests/Fixtures/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ public function registerContainerConfiguration(LoaderInterface $loader)
$container->loadFromExtension('novaway_feature_flag', [
'features' => [
'foo' => true,
'bar' => false,
'bar' => [
'enabled' => false,
'description' => 'Bar feature description',
],
],
]);

Expand Down

0 comments on commit dea9c00

Please sign in to comment.