Skip to content

Commit

Permalink
Move command name to tag attribute
Browse files Browse the repository at this point in the history
This will keep commands lazy loaded and prevents triggering deprecations
when using Symfony 6.1
  • Loading branch information
franmomu committed May 26, 2022
1 parent e82602f commit 5230553
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 44 deletions.
3 changes: 0 additions & 3 deletions Command/ClearMetadataCacheDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
*/
class ClearMetadataCacheDoctrineODMCommand extends MetadataCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:cache:clear-metadata';

protected function configure()
{
parent::configure();
Expand Down
3 changes: 0 additions & 3 deletions Command/CreateSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class CreateSchemaDoctrineODMCommand extends CreateCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:schema:create';

protected function configure()
{
parent::configure();
Expand Down
3 changes: 0 additions & 3 deletions Command/DropSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class DropSchemaDoctrineODMCommand extends DropCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:schema:drop';

protected function configure()
{
parent::configure();
Expand Down
3 changes: 0 additions & 3 deletions Command/GenerateHydratorsDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
*/
class GenerateHydratorsDoctrineODMCommand extends GenerateHydratorsCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:generate:hydrators';

protected function configure()
{
parent::configure();
Expand Down
3 changes: 0 additions & 3 deletions Command/GenerateProxiesDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
*/
class GenerateProxiesDoctrineODMCommand extends GenerateProxiesCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:generate:proxies';

protected function configure()
{
parent::configure();
Expand Down
3 changes: 0 additions & 3 deletions Command/InfoDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
*/
class InfoDoctrineODMCommand extends DoctrineODMCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:mapping:info';

protected function configure()
{
$this
Expand Down
3 changes: 0 additions & 3 deletions Command/LoadDataFixturesDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
*/
class LoadDataFixturesDoctrineODMCommand extends DoctrineODMCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:fixtures:load';

/** @var SymfonyFixturesLoaderInterface */
private $fixturesLoader;

Expand Down
3 changes: 0 additions & 3 deletions Command/QueryDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
*/
class QueryDoctrineODMCommand extends QueryCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:query';

protected function configure()
{
parent::configure();
Expand Down
3 changes: 0 additions & 3 deletions Command/ShardDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class ShardDoctrineODMCommand extends ShardCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:schema:shard';

protected function configure()
{
parent::configure();
Expand Down
3 changes: 0 additions & 3 deletions Command/TailCursorDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class TailCursorDoctrineODMCommand extends Command implements ContainerAwareInte
{
use ContainerAwareTrait;

/** @var string */
protected static $defaultName = 'doctrine:mongodb:tail-cursor';

protected function configure()
{
$this
Expand Down
3 changes: 0 additions & 3 deletions Command/UpdateSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class UpdateSchemaDoctrineODMCommand extends UpdateCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:schema:update';

protected function configure()
{
parent::configure();
Expand Down
22 changes: 11 additions & 11 deletions Resources/config/mongodb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,43 +56,43 @@
<service id="%doctrine_mongodb.odm.class%" alias="doctrine_mongodb" public="false" />

<service id="Doctrine\Bundle\MongoDBBundle\Command\ClearMetadataCacheDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\ClearMetadataCacheDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:cache:clear-metadata"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\CreateSchemaDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\CreateSchemaDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:schema:create"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\DropSchemaDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\DropSchemaDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:schema:drop"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\GenerateHydratorsDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\GenerateHydratorsDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:generate:hydrators"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\GenerateProxiesDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\GenerateProxiesDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:generate:proxies"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\InfoDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\InfoDoctrineODMCommand">
<argument type="service" id="doctrine_mongodb"/>

<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:mapping:info"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\LoadDataFixturesDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\LoadDataFixturesDoctrineODMCommand">
<argument type="service" id="doctrine_mongodb"/>
<argument type="service" id="kernel" on-invalid="null"/>
<argument type="service" id="doctrine_mongodb.odm.symfony.fixtures.loader" on-invalid="null" />

<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:fixtures:load"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\QueryDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\QueryDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:query"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\ShardDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\ShardDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:schema:shard"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\TailCursorDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\TailCursorDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:tail-cursor"/>
</service>
<service id="Doctrine\Bundle\MongoDBBundle\Command\UpdateSchemaDoctrineODMCommand" class="Doctrine\Bundle\MongoDBBundle\Command\UpdateSchemaDoctrineODMCommand">
<tag name="console.command"/>
<tag name="console.command" command="doctrine:mongodb:schema:update"/>
</service>

<!-- events -->
Expand Down

0 comments on commit 5230553

Please sign in to comment.