[Nostromo] Scrutinizer recommendations

This commit is contained in:
Andrés Montañez 2017-01-08 02:25:40 -03:00
parent 7506140b6f
commit c9ac6f60ae
6 changed files with 23 additions and 10 deletions

View file

@ -53,7 +53,7 @@ class DeployCommand extends AbstractCommand
* *
* @param InputInterface $input * @param InputInterface $input
* @param OutputInterface $output * @param OutputInterface $output
* @return int|mixed * @return integer
*/ */
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {

View file

@ -189,7 +189,7 @@ class Runtime
/** /**
* Retrieves the Configuration options for a specific section in the configuration * Retrieves the Configuration options for a specific section in the configuration
* *
* @param mixed $key Section name * @param string $key Section name
* @param mixed $default Default value * @param mixed $default Default value
* @return mixed * @return mixed
*/ */
@ -236,8 +236,8 @@ class Runtime
/** /**
* Overwrites an Environment configuration option * Overwrites an Environment configuration option
* *
* @param $key * @param string $key
* @param $value * @param mixed $value
* @return Runtime * @return Runtime
*/ */
public function setEnvironmentConfig($key, $value) public function setEnvironmentConfig($key, $value)

View file

@ -20,6 +20,12 @@ use Mage\Task\AbstractTask;
*/ */
abstract class AbstractFileTask extends AbstractTask abstract class AbstractFileTask extends AbstractTask
{ {
/**
* Returns the Task options
*
* @return array
* @throws ErrorException
*/
protected function getOptions() protected function getOptions()
{ {
$mandatory = $this->getParameters(); $mandatory = $this->getParameters();
@ -33,8 +39,20 @@ abstract class AbstractFileTask extends AbstractTask
return $this->options; return $this->options;
} }
/**
* Returns the mandatory parameters
*
* @return array
*/
abstract protected function getParameters(); abstract protected function getParameters();
/**
* Returns a file with the placeholders replaced
*
* @param string $file
* @return string
* @throws ErrorException
*/
protected function getFile($file) protected function getFile($file)
{ {
$mapping = [ $mapping = [

View file

@ -11,12 +11,9 @@
namespace Mage\Tests\Command\BuiltIn\Releases; namespace Mage\Tests\Command\BuiltIn\Releases;
use Mage\Command\BuiltIn\Releases\ListCommand; use Mage\Command\BuiltIn\Releases\ListCommand;
use Mage\Runtime\Exception\DeploymentException;
use Mage\Runtime\Exception\RuntimeException;
use Mage\Command\AbstractCommand; use Mage\Command\AbstractCommand;
use Mage\Tests\MageApplicationMockup; use Mage\Tests\MageApplicationMockup;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
use Exception;
use PHPUnit_Framework_TestCase as TestCase; use PHPUnit_Framework_TestCase as TestCase;
class ListCommandTest extends TestCase class ListCommandTest extends TestCase

View file

@ -12,10 +12,8 @@ namespace Mage\Tests\Command\BuiltIn\Releases;
use Mage\Command\BuiltIn\Releases\RollbackCommand; use Mage\Command\BuiltIn\Releases\RollbackCommand;
use Mage\Command\AbstractCommand; use Mage\Command\AbstractCommand;
use Mage\Runtime\Exception\DeploymentException;
use Mage\Tests\MageApplicationMockup; use Mage\Tests\MageApplicationMockup;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
use Exception;
use PHPUnit_Framework_TestCase as TestCase; use PHPUnit_Framework_TestCase as TestCase;
class RollbackCommandTest extends TestCase class RollbackCommandTest extends TestCase

View file

@ -63,7 +63,7 @@ class Utils
public function getReleaseDate($releaseId) public function getReleaseDate($releaseId)
{ {
$formatted = sprintf('%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d', $formatted = sprintf('%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d',
$releaseId[0], $releaseId[1], $releaseId[2], $releaseId[3], $releaseId[0], $releaseId[1], $releaseId[2], $releaseId[3],
$releaseId[4], $releaseId[5], $releaseId[4], $releaseId[5],
$releaseId[6], $releaseId[7], $releaseId[6], $releaseId[7],
$releaseId[8], $releaseId[9], $releaseId[8], $releaseId[9],