Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion config/orm.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand;
use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryRegionCommand;
use Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand;
use Doctrine\ORM\Tools\Console\Command\Debug\DebugEntityListenersDoctrineCommand;
use Doctrine\ORM\Tools\Console\Command\Debug\DebugEventManagerDoctrineCommand;
use Doctrine\ORM\Tools\Console\Command\InfoCommand;
use Doctrine\ORM\Tools\Console\Command\MappingDescribeCommand;
use Doctrine\ORM\Tools\Console\Command\RunDqlCommand;
Expand Down Expand Up @@ -245,5 +247,17 @@
->args([
service('doctrine.orm.command.entity_manager_provider'),
])
->tag('console.command', ['command' => 'doctrine:schema:validate']);
->tag('console.command', ['command' => 'doctrine:schema:validate'])

->set('doctrine.event_manager_debug_command', DebugEventManagerDoctrineCommand::class)

Check failure on line 252 in config/orm.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Doctrine\ORM\Tools\Console\Command\Debug\DebugEventManagerDoctrineCommand not found.
->args([
service('doctrine'),
])
->tag('console.command', ['command' => 'doctrine:debug:event-manager'])

->set('doctrine.entity_listeners_debug_command', DebugEntityListenersDoctrineCommand::class)

Check failure on line 258 in config/orm.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Doctrine\ORM\Tools\Console\Command\Debug\DebugEntityListenersDoctrineCommand not found.
->args([
service('doctrine'),
])
->tag('console.command', ['command' => 'doctrine:debug:entity-listeners']);
};
6 changes: 6 additions & 0 deletions src/DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use Doctrine\ORM\Mapping\MappedSuperclass;
use Doctrine\ORM\Proxy\Autoloader;
use Doctrine\ORM\Tools\AttachEntityListenersListener;
use Doctrine\ORM\Tools\Console\Command\Debug\DebugEventManagerDoctrineCommand;
use Doctrine\ORM\UnitOfWork;
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\Persistence\Mapping\Driver\PHPDriver;
Expand Down Expand Up @@ -776,6 +777,11 @@ private function ormLoad(array $config, ContainerBuilder $container): void
$container->removeDefinition('doctrine.orm.entity_value_resolver.expression_language');
}

if (! class_exists(DebugEventManagerDoctrineCommand::class)) {
$container->removeDefinition('doctrine.event_manager_debug_command');
$container->removeDefinition('doctrine.entity_listeners_debug_command');
}

$controllerResolverDefaults = [];

if (! $config['controller_resolver']['enabled']) {
Expand Down
Loading