Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make commands lazily loaded #642

Merged
merged 1 commit into from
Sep 16, 2020
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
4 changes: 3 additions & 1 deletion Command/ClearMetadataCacheDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
*/
class ClearMetadataCacheDoctrineODMCommand extends MetadataCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:cache:clear-metadata';
kefzce marked this conversation as resolved.
Show resolved Hide resolved

protected function configure()
{
parent::configure();

$this
->setName('doctrine:mongodb:cache:clear-metadata')
->setDescription('Clear all metadata cache for a document manager.')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setHelp(<<<EOT
Expand Down
4 changes: 3 additions & 1 deletion Command/CreateSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
*/
class CreateSchemaDoctrineODMCommand extends CreateCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:schema:create';

protected function configure()
{
parent::configure();

$this
->setName('doctrine:mongodb:schema:create')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
The <info>doctrine:mongodb:schema:create</info> command creates the default document manager's schema:
Expand Down
4 changes: 3 additions & 1 deletion Command/DropSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
*/
class DropSchemaDoctrineODMCommand extends DropCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:schema:drop';

protected function configure()
{
parent::configure();

$this
->setName('doctrine:mongodb:schema:drop')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
The <info>doctrine:mongodb:schema:drop</info> command drops the default document manager's schema:
Expand Down
4 changes: 3 additions & 1 deletion Command/GenerateHydratorsDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
*/
class GenerateHydratorsDoctrineODMCommand extends GenerateHydratorsCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:generate:hydrators';

protected function configure()
{
parent::configure();

$this
->setName('doctrine:mongodb:generate:hydrators')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setHelp(<<<EOT
The <info>doctrine:mongodb:generate:hydrators</info> command generates hydrator classes for your documents:
Expand Down
4 changes: 3 additions & 1 deletion Command/GenerateProxiesDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
*/
class GenerateProxiesDoctrineODMCommand extends GenerateProxiesCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:generate:proxies';

protected function configure()
{
parent::configure();

$this
->setName('doctrine:mongodb:generate:proxies')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setHelp(<<<EOT
The <info>doctrine:mongodb:generate:proxies</info> command generates proxy classes for your default document manager:
Expand Down
4 changes: 3 additions & 1 deletion Command/InfoDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
*/
class InfoDoctrineODMCommand extends DoctrineODMCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:mapping:info';

protected function configure()
{
$this
->setName('doctrine:mongodb:mapping:info')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setDescription('Show basic information about all mapped documents.')
->setHelp(<<<EOT
Expand Down
6 changes: 4 additions & 2 deletions Command/LoadDataFixturesDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
*/
class LoadDataFixturesDoctrineODMCommand extends DoctrineODMCommand
{
/** @var SymfonyFixturesLoaderInterface */
/** @var string */
protected static $defaultName = 'doctrine:mongodb:fixtures:load';

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

public function __construct(?ManagerRegistry $registry = null, ?KernelInterface $kernel = null, ?SymfonyFixturesLoaderInterface $fixturesLoader = null)
Expand All @@ -48,7 +51,6 @@ public function isEnabled()
protected function configure()
{
$this
->setName('doctrine:mongodb:fixtures:load')
->setDescription('Load data fixtures to your database.')
->addOption('services', null, InputOption::VALUE_NONE, 'Use services as fixtures')
->addOption('group', null, InputOption::VALUE_IS_ARRAY|InputOption::VALUE_REQUIRED, 'Only load fixtures that belong to this group (use with --services)')
Expand Down
4 changes: 3 additions & 1 deletion Command/QueryDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
*/
class QueryDoctrineODMCommand extends QueryCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:query';

protected function configure()
{
parent::configure();

$this
->setName('doctrine:mongodb:query')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.');
}

Expand Down
4 changes: 3 additions & 1 deletion Command/ShardDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
*/
class ShardDoctrineODMCommand extends ShardCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:schema:shard';

protected function configure()
{
parent::configure();

$this
->setName('doctrine:mongodb:schema:shard')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
The <info>doctrine:mongodb:schema:shard</info> command shards collections based on their metadata:
Expand Down
4 changes: 3 additions & 1 deletion Command/TailCursorDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ class TailCursorDoctrineODMCommand extends Command implements ContainerAwareInte
{
use ContainerAwareTrait;

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

protected function configure()
{
$this
->setName('doctrine:mongodb:tail-cursor')
->setDescription('Tails a mongodb cursor and processes the documents that come through')
->addArgument('document', InputArgument::REQUIRED, 'The document we are going to tail the cursor for.')
->addArgument('finder', InputArgument::REQUIRED, 'The repository finder method which returns the cursor to tail.')
Expand Down
4 changes: 3 additions & 1 deletion Command/UpdateSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
*/
class UpdateSchemaDoctrineODMCommand extends UpdateCommand
{
/** @var string */
protected static $defaultName = 'doctrine:mongodb:schema:update';

protected function configure()
{
parent::configure();

$this
->setName('doctrine:mongodb:schema:update')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
The <info>doctrine:mongodb:schema:update</info> command updates the default document manager's schema:
Expand Down