Skip to content

Commit

Permalink
PSR2 Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
valerianpereira authored and garfieldius committed Mar 17, 2018
1 parent 8f0f2d2 commit 1341c59
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Mage/Command/BuiltIn/AddCommand.php
Expand Up @@ -38,7 +38,7 @@ public function run()
$this->addEnvironment();
break;

default;
default:
throw new Exception('The Type of Add is needed.');
break;
}
Expand Down
3 changes: 2 additions & 1 deletion Mage/Command/BuiltIn/DeployCommand.php
Expand Up @@ -466,7 +466,8 @@ protected function runRollbackTask(AbstractTask $task)
$this->getConfig()->setHostConfig($hostConfig);
$this->getConfig()->setReleaseId(-1);

$task = Factory::get(array(
$task = Factory::get(
array(
'name'=>'releases/rollback',
'parameters' => array('inDeploy'=>true)
),
Expand Down
2 changes: 1 addition & 1 deletion Mage/Command/BuiltIn/InstallCommand.php
Expand Up @@ -41,7 +41,7 @@ public function run()
if (!is_dir($baseDir) || !is_writable($baseDir)) {
Console::output('<red>Failure: install directory is invalid.</red>', 0, 2);

// Chck if it is a system wide install the user is root
// Chck if it is a system wide install the user is root
} elseif ($systemWide && (getenv('LOGNAME') != 'root')) {
Console::output('<red>Failure: you have to be root to perform a system wide install.</red>', 0, 2);
} else {
Expand Down
3 changes: 2 additions & 1 deletion Mage/Command/BuiltIn/ReleasesCommand.php
Expand Up @@ -37,7 +37,8 @@ public function run()
if (count($hosts) == 0) {
Console::output(
'<light_purple>Warning!</light_purple> <bold>No hosts defined, unable to get releases.</bold>',
1, 3
1,
3
);

return 101;
Expand Down
3 changes: 2 additions & 1 deletion Mage/Config.php
Expand Up @@ -161,7 +161,8 @@ protected function initEnvironment()
*
* @return array the default environment configuration
*/
protected function getDefaultEnvironment() {
protected function getDefaultEnvironment()
{
$defaults = $this->general('defaults', null);
return !empty($defaults) ? $defaults : array();
}
Expand Down
2 changes: 1 addition & 1 deletion Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php
Expand Up @@ -116,7 +116,7 @@ public function run()
* @param array $excludes
* @return string
*/
protected function excludes(Array $excludes)
protected function excludes(array $excludes)
{
$excludesRsync = '';
foreach ($excludes as $exclude) {
Expand Down
10 changes: 5 additions & 5 deletions Mage/Task/BuiltIn/Ioncube/EncryptTask.php
Expand Up @@ -557,24 +557,24 @@ private function mergeConfigFiles()
$s = array();
$p = array();
switch (strtolower($this->ionOverRide)) {
case 'fyd' :
case 'fyd':
// FILE / YAML / DEFAULT
$s = array_merge($this->file ['s'], $this->yaml ['s'], $this->default ['s']);
$p = array_merge($this->file ['p'], $this->yaml ['p'], $this->default ['p']);
break;

case 'yfd' :
case 'yfd':
// YAML / FILE / DEFAULT
$s = array_merge($this->yaml ['s'], $this->file ['s'], $this->default ['s']);
$p = array_merge($this->yaml ['p'], $this->file ['p'], $this->default ['p']);
break;
case 'dyf' :
case 'dyf':
// DEFAULT / YAML / FILE
$s = array_merge($this->default ['s'], $this->yaml ['s'], $this->file ['s']);
$p = array_merge($this->default ['p'], $this->yaml ['p'], $this->file ['p']);
break;
case 'd' :
default :
case 'd':
default:
// Use defaults only
$s = $this->default ['s'];
$p = $this->default ['p'];
Expand Down
4 changes: 3 additions & 1 deletion Mage/Task/BuiltIn/Releases/ListTask.php
Expand Up @@ -80,7 +80,9 @@ public function run()
Console::output(
'Release: <purple>' . $release . '</purple> '
. '- Date: <bold>' . $releaseDate . '</bold> '
. '- Index: <bold>' . $releaseIndex . '</bold>' . $dateDiff . $isCurrent, 2);
. '- Index: <bold>' . $releaseIndex . '</bold>' . $dateDiff . $isCurrent,
2
);
}
}

Expand Down
6 changes: 4 additions & 2 deletions Mage/Task/BuiltIn/Releases/RollbackTask.php
Expand Up @@ -63,8 +63,10 @@ public function run()
Console::output('Release are not available for <bold>' . $this->getConfig()->getHost() . '</bold> ... <red>FAIL</red>');
} else {
rsort($releases);
$deleteCurrent = $this->getConfig()->getParameter('deleteCurrent',
$this->getConfig()->deployment('delete-on-rollback',
$deleteCurrent = $this->getConfig()->getParameter(
'deleteCurrent',
$this->getConfig()->deployment(
'delete-on-rollback',
$this->getConfig()->general('delete-on-rollback', false)
)
);
Expand Down
3 changes: 2 additions & 1 deletion Mage/Yaml/Dumper.php
Expand Up @@ -61,7 +61,8 @@ public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType =
foreach ($input as $key => $value) {
$willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value);

$output .= sprintf('%s%s%s%s',
$output .= sprintf(
'%s%s%s%s',
$prefix,
$isAHash ? Inline::dump($key, $exceptionOnInvalidType, $objectSupport) . ':' : '-',
$willBeInlined ? ' ' : "\n",
Expand Down
5 changes: 3 additions & 2 deletions Mage/Yaml/Inline.php
Expand Up @@ -167,8 +167,8 @@ private static function dumpArray($value, $exceptionOnInvalidType, $objectSuppor
$keys = array_keys($value);
if ((1 == count($keys) && '0' == $keys[0])
|| (count($keys) > 1 && array_reduce($keys, function ($v, $w) {
return (int)$v + $w;
}, 0) == count($keys) * (count($keys) - 1) / 2)
return (int)$v + $w;
}, 0) == count($keys) * (count($keys) - 1) / 2)
) {
$output = array();
foreach ($value as $val) {
Expand Down Expand Up @@ -473,6 +473,7 @@ private static function evaluateScalar($scalar)
case preg_match(self::getTimestampRegex(), $scalar):
return strtotime($scalar);
}
// no break
default:
return (string)$scalar;
}
Expand Down
2 changes: 1 addition & 1 deletion Mage/Yaml/Parser.php
Expand Up @@ -176,7 +176,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport =
if ($isProcessed) {
// Merge keys
$data = $isProcessed;
// hash
// hash
} elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) {
// if next line is less indented or equal, then it means that the current value is null
if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) {
Expand Down

0 comments on commit 1341c59

Please sign in to comment.