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

Add deprecated notices to duplicate Doctrine commands, for #1 #12

Merged
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
29 changes: 10 additions & 19 deletions Command/MigrationsExecuteDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,24 @@

namespace AntiMattr\Bundle\MongoDBMigrationsBundle\Command;

use AntiMattr\MongoDB\Migrations\Tools\Console\Command\ExecuteCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @author Matthew Fitzgerald <matthewfitz@gmail.com>
*
* @deprecated will be removed in version 2.0
*/
class MigrationsExecuteDoctrineCommand extends ExecuteCommand
class MigrationsExecuteDoctrineCommand extends MigrationsExecuteCommand
{
protected function configure()
{
parent::configure();

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

public function execute(InputInterface $input, OutputInterface $output)
{
CommandHelper::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));

$configuration = $this->getMigrationConfiguration($input, $output);
CommandHelper::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
$replacement = str_replace('Doctrine', '', __CLASS__);
$notice = sprintf(
'%s is deprecated and will be removed in 2.0. Use %s instead',
__CLASS__,
$replacement
);

parent::execute($input, $output);
@trigger_error($notice, E_USER_DEPRECATED);
}
}
29 changes: 10 additions & 19 deletions Command/MigrationsGenerateDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,24 @@

namespace AntiMattr\Bundle\MongoDBMigrationsBundle\Command;

use AntiMattr\MongoDB\Migrations\Tools\Console\Command\GenerateCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @author Matthew Fitzgerald <matthewfitz@gmail.com>
*
* @deprecated will be removed in version 2.0
*/
class MigrationsGenerateDoctrineCommand extends GenerateCommand
class MigrationsGenerateDoctrineCommand extends MigrationsGenerateCommand
{
protected function configure()
{
parent::configure();

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

public function execute(InputInterface $input, OutputInterface $output)
{
CommandHelper::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));

$configuration = $this->getMigrationConfiguration($input, $output);
CommandHelper::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
$replacement = str_replace('Doctrine', '', __CLASS__);
$notice = sprintf(
'%s is deprecated and will be removed in 2.0. Use %s instead',
__CLASS__,
$replacement
);

parent::execute($input, $output);
@trigger_error($notice, E_USER_DEPRECATED);
}
}
29 changes: 10 additions & 19 deletions Command/MigrationsMigrateDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,24 @@

namespace AntiMattr\Bundle\MongoDBMigrationsBundle\Command;

use AntiMattr\MongoDB\Migrations\Tools\Console\Command\MigrateCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @author Matthew Fitzgerald <matthewfitz@gmail.com>
*
* @deprecated will be removed in version 2.0
*/
class MigrationsMigrateDoctrineCommand extends MigrateCommand
class MigrationsMigrateDoctrineCommand extends MigrationsMigrateCommand
{
protected function configure()
{
parent::configure();

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

public function execute(InputInterface $input, OutputInterface $output)
{
CommandHelper::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));

$configuration = $this->getMigrationConfiguration($input, $output);
CommandHelper::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
$replacement = str_replace('Doctrine', '', __CLASS__);
$notice = sprintf(
'%s is deprecated and will be removed in 2.0. Use %s instead',
__CLASS__,
$replacement
);

parent::execute($input, $output);
@trigger_error($notice, E_USER_DEPRECATED);
}
}
29 changes: 10 additions & 19 deletions Command/MigrationsStatusDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,24 @@

namespace AntiMattr\Bundle\MongoDBMigrationsBundle\Command;

use AntiMattr\MongoDB\Migrations\Tools\Console\Command\StatusCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @author Matthew Fitzgerald <matthewfitz@gmail.com>
*
* @deprecated will be removed in version 2.0
*/
class MigrationsStatusDoctrineCommand extends StatusCommand
class MigrationsStatusDoctrineCommand extends MigrationsStatusCommand
{
protected function configure()
{
parent::configure();

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

public function execute(InputInterface $input, OutputInterface $output)
{
CommandHelper::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));

$configuration = $this->getMigrationConfiguration($input, $output);
CommandHelper::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
$replacement = str_replace('Doctrine', '', __CLASS__);
$notice = sprintf(
'%s is deprecated and will be removed in 2.0. Use %s instead',
__CLASS__,
$replacement
);

parent::execute($input, $output);
@trigger_error($notice, E_USER_DEPRECATED);
}
}
29 changes: 10 additions & 19 deletions Command/MigrationsVersionDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,24 @@

namespace AntiMattr\Bundle\MongoDBMigrationsBundle\Command;

use AntiMattr\MongoDB\Migrations\Tools\Console\Command\VersionCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @author Matthew Fitzgerald <matthewfitz@gmail.com>
*
* @deprecated will be removed in version 2.0
*/
class MigrationsVersionDoctrineCommand extends VersionCommand
class MigrationsVersionDoctrineCommand extends MigrationsVersionCommand
{
protected function configure()
{
parent::configure();

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

public function execute(InputInterface $input, OutputInterface $output)
{
CommandHelper::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));

$configuration = $this->getMigrationConfiguration($input, $output);
CommandHelper::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
$replacement = str_replace('Doctrine', '', __CLASS__);
$notice = sprintf(
'%s is deprecated and will be removed in 2.0. Use %s instead',
__CLASS__,
$replacement
);

parent::execute($input, $output);
@trigger_error($notice, E_USER_DEPRECATED);
}
}