Skip to content

Commit e089260

Browse files
loic425fabpot
authored andcommitted
[Validator] Debug validator command
1 parent 2eec59d commit e089260

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,8 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
12171217
private function registerValidationConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader, bool $propertyInfoEnabled)
12181218
{
12191219
if (!$this->validatorConfigEnabled = $this->isConfigEnabled($container, $config)) {
1220+
$container->removeDefinition('console.command.validator_debug');
1221+
12201222
return;
12211223
}
12221224

Resources/config/console.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
use Symfony\Component\Messenger\Command\SetupTransportsCommand;
4848
use Symfony\Component\Messenger\Command\StopWorkersCommand;
4949
use Symfony\Component\Translation\Command\XliffLintCommand;
50+
use Symfony\Component\Validator\Command\DebugCommand as ValidatorDebugCommand;
5051

5152
return static function (ContainerConfigurator $container) {
5253
$container->services()
@@ -225,6 +226,12 @@
225226
])
226227
->tag('console.command', ['command' => 'translation:update'])
227228

229+
->set('console.command.validator_debug', ValidatorDebugCommand::class)
230+
->args([
231+
service('validator'),
232+
])
233+
->tag('console.command', ['command' => 'debug:validator'])
234+
228235
->set('console.command.workflow_dump', WorkflowDumpCommand::class)
229236
->tag('console.command', ['command' => 'workflow:dump'])
230237

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"symfony/polyfill-php80": "^1.15",
3030
"symfony/filesystem": "^4.4|^5.0",
3131
"symfony/finder": "^4.4|^5.0",
32-
"symfony/routing": "^5.1"
32+
"symfony/routing": "^5.1",
33+
"symfony/validator": "^5.2"
3334
},
3435
"require-dev": {
3536
"doctrine/annotations": "~1.7",
@@ -57,7 +58,6 @@
5758
"symfony/string": "^5.0",
5859
"symfony/translation": "^5.0",
5960
"symfony/twig-bundle": "^4.4|^5.0",
60-
"symfony/validator": "^4.4|^5.0",
6161
"symfony/workflow": "^5.2",
6262
"symfony/yaml": "^4.4|^5.0",
6363
"symfony/property-info": "^4.4|^5.0",

0 commit comments

Comments
 (0)