Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Fix dumping extension config without bundle#46412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -16,6 +16,7 @@ | ||
| use Symfony\Component\Console\Helper\Table; | ||
| use Symfony\Component\Console\Output\OutputInterface; | ||
| use Symfony\Component\Console\Style\StyleInterface; | ||
| use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
| use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; | ||
| /** | ||
| @@ -59,7 +60,7 @@ protected function listBundles($output) | ||
| /** | ||
| * @return ExtensionInterface | ||
| */ | ||
| protected function findExtension($name, ContainerBuilder $container) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. that's a BC break MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. My bad! I don't remember, is it ok to add a new deprecation in a patch version? Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. We cannot do that in a patch release. MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Fixed in#46434 | ||
| { | ||
| $bundles = $this->initializeBundles(); | ||
| $minScore = \INF; | ||
| @@ -79,20 +80,18 @@ protected function findExtension($name) | ||
| $guess = $bundle->getName(); | ||
| $minScore = $distance; | ||
| } | ||
| } | ||
| if ($container->hasExtension($name)) { | ||
| return $container->getExtension($name); | ||
| } | ||
| foreach ($container->getExtensions() as $extension) { | ||
| $distance = levenshtein($name, $extension->getAlias()); | ||
| if ($distance < $minScore) { | ||
| $guess = $extension->getAlias(); | ||
| $minScore = $distance; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <?php | ||
| /* | ||
| * This file is part of the Symfony package. | ||
| * | ||
| * (c) Fabien Potencier <fabien@symfony.com> | ||
| * | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
| namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Extension; | ||
| use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
| use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
| use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
| use Symfony\Component\DependencyInjection\Extension\Extension; | ||
| class TestDumpExtension extends Extension implements ConfigurationInterface | ||
| { | ||
| public function getConfigTreeBuilder() | ||
| { | ||
| $treeBuilder = new TreeBuilder('test_dump'); | ||
| $treeBuilder->getRootNode() | ||
| ->children() | ||
| ->booleanNode('enabled')->defaultTrue()->end() | ||
| ->end() | ||
| ; | ||
| return $treeBuilder; | ||
| } | ||
| public function load(array $configs, ContainerBuilder $container) | ||
| { | ||
| } | ||
| public function getConfiguration(array $config, ContainerBuilder $container) | ||
| { | ||
| return $this; | ||
| } | ||
| } |