Skip to content

Commit

Permalink
Correct console commands to be suffixed with Console and deprecate th…
Browse files Browse the repository at this point in the history
…e former one.
  • Loading branch information
dereuromark committed Jun 24, 2016
1 parent a55b01f commit 28f7d09
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 32 deletions.
34 changes: 2 additions & 32 deletions src/Spryker/Zed/Oms/Communication/Console/ClearLocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,9 @@

namespace Spryker\Zed\Oms\Communication\Console;

use Spryker\Zed\Console\Business\Model\Console;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @method \Spryker\Zed\Oms\Business\OmsFacade getFacade()
* @deprecated Use \Spryker\Zed\Oms\Communication\ClearLocksConsole instead.
*/
class ClearLocks extends Console
class ClearLocks extends ClearLocksConsole
{

const COMMAND_NAME = 'oms:clear-locks';
const COMMAND_DESCRIPTION = 'Clear OMS state machine expired locks from lock table';

/**
* @return void
*/
protected function configure()
{
$this->setName(self::COMMAND_NAME);
$this->setDescription(self::COMMAND_DESCRIPTION);

parent::configure();
}

/**
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
*
* @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->getFacade()->clearLocks();
}

}
44 changes: 44 additions & 0 deletions src/Spryker/Zed/Oms/Communication/Console/ClearLocksConsole.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/

namespace Spryker\Zed\Oms\Communication\Console;

use Spryker\Zed\Console\Business\Model\Console;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @method \Spryker\Zed\Oms\Business\OmsFacade getFacade()
*/
class ClearLocksConsole extends Console
{

const COMMAND_NAME = 'oms:clear-locks';
const COMMAND_DESCRIPTION = 'Clear OMS state machine expired locks from lock table';

/**
* @return void
*/
protected function configure()
{
$this->setName(self::COMMAND_NAME);
$this->setDescription(self::COMMAND_DESCRIPTION);

parent::configure();
}

/**
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
*
* @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->getFacade()->clearLocks();
}

}

0 comments on commit 28f7d09

Please sign in to comment.