From d4a09881f1eed940b86da0e71cde295f4135678c Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 26 Jun 2012 10:46:00 +0200 Subject: [PATCH] [FrameworkBundle] added configuration interface check Added check for ConfigurationInterface to config ref dumping command. To ensure that configuration implements needed `getConfigTreeBuilder()` command --- .../FrameworkBundle/Command/ConfigDumpReferenceCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php index 5d9d06b32aa8..cd43ca00f5c8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php @@ -17,6 +17,7 @@ use Symfony\Component\Config\Definition\NodeInterface; use Symfony\Component\Config\Definition\ArrayNode; use Symfony\Component\Config\Definition\PrototypedArrayNode; +use Symfony\Component\Config\Definition\ConfigurationInterface; /** * A console command for dumping available configuration reference @@ -102,6 +103,12 @@ protected function execute(InputInterface $input, OutputInterface $output) '" does not have it\'s getConfiguration() method setup'); } + if (!$configuration instanceof ConfigurationInterface) { + throw new \LogicException( + 'Configuration class "'.get_class($configuration). + '" should implement ConfigurationInterface in order to be dumpable'); + } + $rootNode = $configuration->getConfigTreeBuilder()->buildTree(); $output->writeln($message);