@@ -51,7 +51,7 @@ |
||
| 51 | 51 | */ |
| 52 | 52 | public function getArgumentValue($name) |
| 53 | 53 | { |
| 54 | - return array_reduce($this->arguments, function ($carry, $item) use ($name) { |
|
| 54 | + return array_reduce($this->arguments, function($carry, $item) use ($name) { |
|
| 55 | 55 | if (substr(strtolower($item), 0, strlen($name) + 2) == '--' . $name) { |
| 56 | 56 | $val = explode('=', $item); |
| 57 | 57 | return trim($val[1]); |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * @param $inFile |
| 88 | - * @param null $outFile |
|
| 88 | + * @param string $outFile |
|
| 89 | 89 | * @param array $stack |
| 90 | 90 | * @return array|bool|mixed |
| 91 | 91 | */ |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if (!is_null($outFile)) { |
| 120 | - ksort($values[self::$PARAMETER_KEY]); |
|
| 120 | + ksort($values[self::$PARAMETER_KEY]); |
|
| 121 | 121 | $this->fs->dumpFile($outFile, Yaml::dump($values)); |
| 122 | 122 | } else { |
| 123 | 123 | return $values; |
@@ -155,14 +155,14 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | protected function processEnvironmentalVariables(array $parameters) |
| 157 | 157 | { |
| 158 | - $processed = array(); |
|
| 159 | - foreach ($parameters as $key => $parameter) { |
|
| 160 | - if (!is_string($parameter)) { |
|
| 161 | - $processed[$key] = $parameter; |
|
| 162 | - } else { |
|
| 163 | - $processed[$key] = $this->fileHandler->processEnvironmentalVariable($parameter); |
|
| 164 | - } |
|
| 165 | - } |
|
| 166 | - return $processed; |
|
| 158 | + $processed = array(); |
|
| 159 | + foreach ($parameters as $key => $parameter) { |
|
| 160 | + if (!is_string($parameter)) { |
|
| 161 | + $processed[$key] = $parameter; |
|
| 162 | + } else { |
|
| 163 | + $processed[$key] = $this->fileHandler->processEnvironmentalVariable($parameter); |
|
| 164 | + } |
|
| 165 | + } |
|
| 166 | + return $processed; |
|
| 167 | 167 | } |
| 168 | 168 | } |
@@ -19,25 +19,25 @@ |
||
| 19 | 19 | file_put_contents($fileName, $content, 99); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @param $value |
|
| 24 | - * @return string |
|
| 25 | - */ |
|
| 22 | + /** |
|
| 23 | + * @param $value |
|
| 24 | + * @return string |
|
| 25 | + */ |
|
| 26 | 26 | protected function serialize($value) { |
| 27 | - switch (gettype($value)) { |
|
| 28 | - case 'boolean': |
|
| 29 | - return $value ? 'true' : 'false'; |
|
| 30 | - case 'array': |
|
| 31 | - case 'object': |
|
| 32 | - return "'" . addslashes(serialize($value)) . "'"; |
|
| 33 | - case 'NULL': |
|
| 34 | - return "null"; |
|
| 35 | - case 'integer': |
|
| 36 | - case 'double': |
|
| 37 | - return $value; |
|
| 38 | - default: |
|
| 39 | - return "'" . addslashes($value) . "'"; |
|
| 40 | - } |
|
| 41 | - } |
|
| 27 | + switch (gettype($value)) { |
|
| 28 | + case 'boolean': |
|
| 29 | + return $value ? 'true' : 'false'; |
|
| 30 | + case 'array': |
|
| 31 | + case 'object': |
|
| 32 | + return "'" . addslashes(serialize($value)) . "'"; |
|
| 33 | + case 'NULL': |
|
| 34 | + return "null"; |
|
| 35 | + case 'integer': |
|
| 36 | + case 'double': |
|
| 37 | + return $value; |
|
| 38 | + default: |
|
| 39 | + return "'" . addslashes($value) . "'"; |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | 43 | } |
| 44 | 44 | \ No newline at end of file |