mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-08 14:28:57 +02:00
[Nostromo] Improve code
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
namespace Mage\Command;
|
namespace Mage\Command;
|
||||||
|
|
||||||
|
use Mage\Utils;
|
||||||
use Mage\Runtime\Runtime;
|
use Mage\Runtime\Runtime;
|
||||||
use Psr\Log\LogLevel;
|
use Psr\Log\LogLevel;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
@@ -21,6 +22,11 @@ use Symfony\Component\Console\Command\Command;
|
|||||||
*/
|
*/
|
||||||
abstract class AbstractCommand extends Command
|
abstract class AbstractCommand extends Command
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $statusCode = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Runtime Current Runtime instance
|
* @var Runtime Current Runtime instance
|
||||||
*/
|
*/
|
||||||
@@ -49,4 +55,14 @@ abstract class AbstractCommand extends Command
|
|||||||
{
|
{
|
||||||
$this->runtime->log($message, $level);
|
$this->runtime->log($message, $level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Human friendly Stage name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function getStageName()
|
||||||
|
{
|
||||||
|
return Utils::getStageName($this->runtime->getStage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ use Mage\Task\AbstractTask;
|
|||||||
use Mage\Task\Exception\ErrorException;
|
use Mage\Task\Exception\ErrorException;
|
||||||
use Mage\Task\Exception\SkipException;
|
use Mage\Task\Exception\SkipException;
|
||||||
use Mage\Task\TaskFactory;
|
use Mage\Task\TaskFactory;
|
||||||
use Mage\Utils;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
@@ -31,11 +30,6 @@ use Mage\Command\AbstractCommand;
|
|||||||
*/
|
*/
|
||||||
class DeployCommand extends AbstractCommand
|
class DeployCommand extends AbstractCommand
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
protected $statusCode = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var TaskFactory
|
* @var TaskFactory
|
||||||
*/
|
*/
|
||||||
@@ -313,14 +307,4 @@ class DeployCommand extends AbstractCommand
|
|||||||
|
|
||||||
return ($succeededTasks == $totalTasks);
|
return ($succeededTasks == $totalTasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the Human friendly Stage name
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function getStageName()
|
|
||||||
{
|
|
||||||
return Utils::getStageName($this->runtime->getStage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user