Skip to content

Commit 248c579

Browse files
jschaedlnicolas-grekas
authored andcommitted
[FrameworkBundle] Add check for installed yaml component
1 parent 53fe48b commit 248c579

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Command/ConfigDumpReferenceCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\Console\Style\SymfonyStyle;
2323
use Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface;
2424
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
25+
use Symfony\Component\Yaml\Yaml;
2526

2627
/**
2728
* A console command for dumping available configuration reference.
@@ -112,6 +113,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
112113
$this->validateConfiguration($extension, $configuration);
113114

114115
$format = $input->getOption('format');
116+
117+
if ('yaml' === $format && !class_exists(Yaml::class)) {
118+
$errorIo->error('Setting the "format" option to "yaml" requires the Symfony Yaml component. Try running "composer install symfony/yaml" or use "--format=xml" instead.');
119+
120+
return 1;
121+
}
122+
115123
$path = $input->getArgument('path');
116124

117125
if (null !== $path && 'yaml' !== $format) {

0 commit comments

Comments
 (0)