8000 [FrameworkBundle] added configuration interface check · jeremymarc/symfony@d4a0988 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4a0988

Browse files
committed
[FrameworkBundle] added configuration interface check
Added check for ConfigurationInterface to config ref dumping command. To ensure that configuration implements needed `getConfigTreeBuilder()` command
1 parent d131f9d commit d4a0988

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\Config\Definition\NodeInterface;
1818
use Symfony\Component\Config\Definition\ArrayNode;
1919
use Symfony\Component\Config\Definition\PrototypedArrayNode;
20+
use Symfony\Component\Config\Definition\ConfigurationInterface;
2021

2122
/**
2223
* A console command for dumping available configuration reference
@@ -102,6 +103,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
102103
'" does not have it\'s getConfiguration() method setup');
103104
}
104105

106+
if (!$configuration instanceof ConfigurationInterface) {
107+
throw new \LogicException(
108+
'Configuration class "'.get_class($configuration).
109+
'" should implement ConfigurationInterface in order to be dumpable');
110+
}
111+
105112
$rootNode = $configuration->getConfigTreeBuilder()->buildTree();
106113

107114
$output->writeln($message);

0 commit comments

Comments
 (0)
0