Skip to content

Commit 97fdf31

Browse files
committed
Fix debug:form definition
1 parent ecf54d5 commit 97fdf31

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Symfony/Component/Form/DependencyInjection/FormPass.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1919
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
2020
use Symfony\Component\DependencyInjection\Reference;
21-
use Symfony\Component\Form\Command\DebugCommand;
2221

2322
/**
2423
* Adds all services with the tags "form.type", "form.type_extension" and
@@ -36,7 +35,7 @@ class FormPass implements CompilerPassInterface
3635
private $formTypeGuesserTag;
3736
private $formDebugCommandService;
3837

39-
public function __construct($formExtensionService = 'form.extension', $formTypeTag = 'form.type', $formTypeExtensionTag = 'form.type_extension', $formTypeGuesserTag = 'form.type_guesser', $formDebugCommandService = DebugCommand::class)
38+
public function __construct($formExtensionService = 'form.extension', $formTypeTag = 'form.type', $formTypeExtensionTag = 'form.type_extension', $formTypeGuesserTag = 'form.type_guesser', $formDebugCommandService = 'console.command.form_debug')
4039
{
4140
$this->formExtensionService = $formExtensionService;
4241
$this->formTypeTag = $formTypeTag;

src/Symfony/Component/Form/Tests/DependencyInjection/FormPassTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1616
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
17-
use Symfony\Component\Form\Command\DebugCommand;
1817
use Symfony\Component\Form\DependencyInjection\FormPass;
1918
use Symfony\Component\DependencyInjection\ContainerBuilder;
2019
use Symfony\Component\DependencyInjection\Definition;
@@ -43,7 +42,7 @@ public function testDoNothingIfDebugCommandNotLoaded()
4342

4443
$container->compile();
4544

46-
$this->assertFalse($container->hasDefinition(DebugCommand::class));
45+
$this->assertFalse($container->hasDefinition('console.command.form_debug'));
4746
}
4847

4948
public function testAddTaggedTypes()
@@ -72,13 +71,13 @@ public function testAddTaggedTypesToDebugCommand()
7271
$container = $this->createContainerBuilder();
7372

7473
$container->setDefinition('form.extension', $this->createExtensionDefinition());
75-
$container->setDefinition(DebugCommand::class, $this->createDebugCommandDefinition());
74+
$container->setDefinition('console.command.form_debug', $this->createDebugCommandDefinition());
7675
$container->register('my.type1', __CLASS__.'_Type1')->addTag('form.type')->setPublic(true);
7776
$container->register('my.type2', __CLASS__.'_Type2')->addTag('form.type')->setPublic(true);
7877

7978
$container->compile();
8079

81-
$cmdDefinition = $container->getDefinition(DebugCommand::class);
80+
$cmdDefinition = $container->getDefinition('console.command.form_debug');
8281

8382
$this->assertEquals(
8483
array(

0 commit comments

Comments
 (0)