diff --git a/Mage/Command/BuiltIn/AddCommand.php b/Mage/Command/BuiltIn/AddCommand.php index 26d9a37b..db9724eb 100644 --- a/Mage/Command/BuiltIn/AddCommand.php +++ b/Mage/Command/BuiltIn/AddCommand.php @@ -38,7 +38,7 @@ public function run() $this->addEnvironment(); break; - default; + default: throw new Exception('The Type of Add is needed.'); break; } diff --git a/Mage/Command/BuiltIn/DeployCommand.php b/Mage/Command/BuiltIn/DeployCommand.php index 91057921..5c2ba089 100644 --- a/Mage/Command/BuiltIn/DeployCommand.php +++ b/Mage/Command/BuiltIn/DeployCommand.php @@ -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) ), diff --git a/Mage/Command/BuiltIn/InstallCommand.php b/Mage/Command/BuiltIn/InstallCommand.php index 530e1d72..76cc501f 100644 --- a/Mage/Command/BuiltIn/InstallCommand.php +++ b/Mage/Command/BuiltIn/InstallCommand.php @@ -41,7 +41,7 @@ public function run() if (!is_dir($baseDir) || !is_writable($baseDir)) { Console::output('Failure: install directory is invalid.', 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('Failure: you have to be root to perform a system wide install.', 0, 2); } else { diff --git a/Mage/Command/BuiltIn/ReleasesCommand.php b/Mage/Command/BuiltIn/ReleasesCommand.php index 3a40439e..b3c696cc 100644 --- a/Mage/Command/BuiltIn/ReleasesCommand.php +++ b/Mage/Command/BuiltIn/ReleasesCommand.php @@ -37,7 +37,8 @@ public function run() if (count($hosts) == 0) { Console::output( 'Warning! No hosts defined, unable to get releases.', - 1, 3 + 1, + 3 ); return 101; diff --git a/Mage/Config.php b/Mage/Config.php index 18e45c3f..e73449e9 100644 --- a/Mage/Config.php +++ b/Mage/Config.php @@ -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(); } diff --git a/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php b/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php index 6860b212..63ab413d 100644 --- a/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php +++ b/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php @@ -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) { diff --git a/Mage/Task/BuiltIn/Ioncube/EncryptTask.php b/Mage/Task/BuiltIn/Ioncube/EncryptTask.php index c51032d0..9d7fc43c 100644 --- a/Mage/Task/BuiltIn/Ioncube/EncryptTask.php +++ b/Mage/Task/BuiltIn/Ioncube/EncryptTask.php @@ -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']; diff --git a/Mage/Task/BuiltIn/Releases/ListTask.php b/Mage/Task/BuiltIn/Releases/ListTask.php index 9b868520..804192e1 100644 --- a/Mage/Task/BuiltIn/Releases/ListTask.php +++ b/Mage/Task/BuiltIn/Releases/ListTask.php @@ -80,7 +80,9 @@ public function run() Console::output( 'Release: ' . $release . ' ' . '- Date: ' . $releaseDate . ' ' - . '- Index: ' . $releaseIndex . '' . $dateDiff . $isCurrent, 2); + . '- Index: ' . $releaseIndex . '' . $dateDiff . $isCurrent, + 2 + ); } } diff --git a/Mage/Task/BuiltIn/Releases/RollbackTask.php b/Mage/Task/BuiltIn/Releases/RollbackTask.php index dca87671..b989a30d 100644 --- a/Mage/Task/BuiltIn/Releases/RollbackTask.php +++ b/Mage/Task/BuiltIn/Releases/RollbackTask.php @@ -63,8 +63,10 @@ public function run() Console::output('Release are not available for ' . $this->getConfig()->getHost() . ' ... FAIL'); } 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) ) ); diff --git a/Mage/Yaml/Dumper.php b/Mage/Yaml/Dumper.php index 1a594df8..9db130fa 100644 --- a/Mage/Yaml/Dumper.php +++ b/Mage/Yaml/Dumper.php @@ -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", diff --git a/Mage/Yaml/Inline.php b/Mage/Yaml/Inline.php index 0341f787..2f67af30 100644 --- a/Mage/Yaml/Inline.php +++ b/Mage/Yaml/Inline.php @@ -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) { @@ -473,6 +473,7 @@ private static function evaluateScalar($scalar) case preg_match(self::getTimestampRegex(), $scalar): return strtotime($scalar); } + // no break default: return (string)$scalar; } diff --git a/Mage/Yaml/Parser.php b/Mage/Yaml/Parser.php index 4237dc59..6ed228bd 100644 --- a/Mage/Yaml/Parser.php +++ b/Mage/Yaml/Parser.php @@ -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()) {