Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c3ba3a

Browse files
minor #38394 [FrameworkBundle] Add check for installed yaml component (jschaedl)
This PR was submitted for the master branch but it was squashed and merged into the 5.x branch instead. Discussion ---------- [FrameworkBundle] Add check for installed yaml component | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #38301 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | - <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> **Todo:** - [ ] add tests Commits ------- f174ad2 [FrameworkBundle] Add check for installed yaml component
2 parents 96a725f + f174ad2 commit 5c3ba3a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/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)