@@ -171,15 +171,15 @@ |
||
171 | 171 | $ucType = ucfirst($type); |
172 | 172 | if (!strpos($definition, '\\')) { |
173 | 173 | $taskClass = str_replace(' ', '\\', ucwords(str_replace('-', ' ', $definition))); |
174 | - $taskClass = $taskClass . ($postfixType ? $ucType : ''); |
|
174 | + $taskClass = $taskClass.($postfixType ? $ucType : ''); |
|
175 | 175 | foreach ($this->namespaces[$type] as $namespace) { |
176 | - $potentialClass = '\\' . $namespace . '\\' . $taskClass; |
|
176 | + $potentialClass = '\\'.$namespace.'\\'.$taskClass; |
|
177 | 177 | if (class_exists($potentialClass)) { |
178 | 178 | return $potentialClass; |
179 | 179 | } |
180 | 180 | } |
181 | - } elseif (!is_subclass_of(ltrim($definition, '\\'), 'Netresearch\\Kite\\' . $ucType)) { |
|
182 | - throw new Exception($definition .' must extend Netresearch\\Kite\\' . $ucType); |
|
181 | + } elseif (!is_subclass_of(ltrim($definition, '\\'), 'Netresearch\\Kite\\'.$ucType)) { |
|
182 | + throw new Exception($definition.' must extend Netresearch\\Kite\\'.$ucType); |
|
183 | 183 | } |
184 | 184 | return $definition; |
185 | 185 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | $dir = rtrim($dir, '/\\'); |
86 | 86 | |
87 | - return count(glob($dir . '/*') ?: array()) === 0 && count(glob($dir . '/.*') ?: array()) === 2; |
|
87 | + return count(glob($dir.'/*') ?: array()) === 0 && count(glob($dir.'/.*') ?: array()) === 2; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | if (preg_match('{^(?:[a-z]:)?[/\\\\]+$}i', $directory)) { |
107 | - throw new \RuntimeException('Aborting an attempted deletion of ' . $directory . ', this was probably not intended, if it is a real use case please report it.'); |
|
107 | + throw new \RuntimeException('Aborting an attempted deletion of '.$directory.', this was probably not intended, if it is a real use case please report it.'); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | if (!function_exists('proc_open')) { |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | if (!is_dir($directory)) { |
162 | 162 | if (file_exists($directory)) { |
163 | 163 | throw new \RuntimeException( |
164 | - $directory . ' exists and is not a directory.' |
|
164 | + $directory.' exists and is not a directory.' |
|
165 | 165 | ); |
166 | 166 | } |
167 | 167 | if (!@mkdir($directory, 0777, true)) { |
168 | 168 | throw new \RuntimeException( |
169 | - $directory . ' does not exist and could not be created.' |
|
169 | + $directory.' does not exist and could not be created.' |
|
170 | 170 | ); |
171 | 171 | } |
172 | 172 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $this->ensureDirectoryExists($target); |
208 | 208 | |
209 | 209 | foreach ($ri as $file) { |
210 | - $targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName(); |
|
210 | + $targetPath = $target.DIRECTORY_SEPARATOR.$ri->getSubPathName(); |
|
211 | 211 | if ($file->isDir()) { |
212 | 212 | $this->ensureDirectoryExists($targetPath); |
213 | 213 | } else { |
@@ -293,11 +293,11 @@ discard block |
||
293 | 293 | } |
294 | 294 | |
295 | 295 | if (dirname($from) === dirname($to)) { |
296 | - return './' . basename($to); |
|
296 | + return './'.basename($to); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | $commonPath = $to; |
300 | - while (strpos($from . '/', $commonPath . '/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath)) { |
|
300 | + while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath)) { |
|
301 | 301 | $commonPath = strtr(dirname($commonPath), '\\', '/'); |
302 | 302 | } |
303 | 303 | |
@@ -305,11 +305,11 @@ discard block |
||
305 | 305 | return $to; |
306 | 306 | } |
307 | 307 | |
308 | - $commonPath = rtrim($commonPath, '/') . '/'; |
|
308 | + $commonPath = rtrim($commonPath, '/').'/'; |
|
309 | 309 | $sourcePathDepth = substr_count(substr($from, strlen($commonPath)), '/'); |
310 | 310 | $commonPathCode = str_repeat('../', $sourcePathDepth); |
311 | 311 | |
312 | - return ($commonPathCode . substr($to, strlen($commonPath))) ?: './'; |
|
312 | + return ($commonPathCode.substr($to, strlen($commonPath))) ?: './'; |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | $commonPath = $to; |
340 | - while (strpos($from . '/', $commonPath . '/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) { |
|
340 | + while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) { |
|
341 | 341 | $commonPath = strtr(dirname($commonPath), '\\', '/'); |
342 | 342 | } |
343 | 343 | |
@@ -345,15 +345,15 @@ discard block |
||
345 | 345 | return var_export($to, true); |
346 | 346 | } |
347 | 347 | |
348 | - $commonPath = rtrim($commonPath, '/') . '/'; |
|
349 | - if (strpos($to, $from . '/') === 0) { |
|
350 | - return '__DIR__ . ' . var_export(substr($to, strlen($from)), true); |
|
348 | + $commonPath = rtrim($commonPath, '/').'/'; |
|
349 | + if (strpos($to, $from.'/') === 0) { |
|
350 | + return '__DIR__ . '.var_export(substr($to, strlen($from)), true); |
|
351 | 351 | } |
352 | 352 | $sourcePathDepth = substr_count(substr($from, strlen($commonPath)), '/') + $directories; |
353 | - $commonPathCode = str_repeat('dirname(', $sourcePathDepth) . '__DIR__' . str_repeat(')', $sourcePathDepth); |
|
353 | + $commonPathCode = str_repeat('dirname(', $sourcePathDepth).'__DIR__'.str_repeat(')', $sourcePathDepth); |
|
354 | 354 | $relTarget = substr($to, strlen($commonPath)); |
355 | 355 | |
356 | - return $commonPathCode . (strlen($relTarget) ? '.' . var_export('/' . $relTarget, true) : ''); |
|
356 | + return $commonPathCode.(strlen($relTarget) ? '.'.var_export('/'.$relTarget, true) : ''); |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | /** |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | } |
427 | 427 | } |
428 | 428 | |
429 | - return $prefix . ($absolute ? '/' : '') . implode('/', $parts); |
|
429 | + return $prefix.($absolute ? '/' : '').implode('/', $parts); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } elseif (is_array($command)) { |
67 | 67 | $command = implode('; ', $command); |
68 | 68 | } else { |
69 | - throw new \Netresearch\Kite\Exception('Command must be string or array, ' . gettype($command) . ' given.', 1312454906); |
|
69 | + throw new \Netresearch\Kite\Exception('Command must be string or array, '.gettype($command).' given.', 1312454906); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | parent::__construct($command, $cwd, null, null, null); |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | { |
142 | 142 | $command = $this->getCommandLine(); |
143 | 143 | |
144 | - $this->console->output('<cmd>' . $this->getWorkingDirectory() . ' > ' . $command . '</cmd>', OutputInterface::VERBOSITY_VERBOSE); |
|
144 | + $this->console->output('<cmd>'.$this->getWorkingDirectory().' > '.$command.'</cmd>', OutputInterface::VERBOSITY_VERBOSE); |
|
145 | 145 | |
146 | 146 | if ($this->dryRun) { |
147 | 147 | return null; |
148 | 148 | } |
149 | 149 | |
150 | 150 | parent::run( |
151 | - function ($type, $buffer) use ($callback) { |
|
151 | + function($type, $buffer) use ($callback) { |
|
152 | 152 | if ($callback) { |
153 | 153 | call_user_func($callback, $type, $buffer); |
154 | 154 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | public function offsetSet($name, $value) |
72 | 72 | { |
73 | 73 | if (in_array($name, ['workflow', 'script', 'task', 'tasks'], true)) { |
74 | - throw new Exception($name . ' not allowed on workflows'); |
|
74 | + throw new Exception($name.' not allowed on workflows'); |
|
75 | 75 | } |
76 | 76 | parent::offsetSet($name, $value); |
77 | 77 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | if ($name === 'options' || $name === 'arguments') { |
126 | 126 | $type = substr($name, 0, -1); |
127 | 127 | if (!is_array($value)) { |
128 | - throw new Exception($name . ' must be array'); |
|
128 | + throw new Exception($name.' must be array'); |
|
129 | 129 | } |
130 | 130 | foreach ($value as $variable => $config) { |
131 | 131 | $from = $this->camelCaseToLowerCaseDashed($variable); |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | if (($value === null || is_array($value) && !isset($value[0]) && count($value) <= 1) |
166 | 166 | && preg_match('/(^|\|)bool(ean)?($|\|)/', $config['type']) && strpos($config['type'], '|') |
167 | 167 | ) { |
168 | - if ($input->hasParameterOption($opt = '--' . $from) |
|
168 | + if ($input->hasParameterOption($opt = '--'.$from) |
|
169 | 169 | || array_key_exists('shortcut', $config) |
170 | - && $input->hasParameterOption($opt = '-' . $config['shortcut']) |
|
170 | + && $input->hasParameterOption($opt = '-'.$config['shortcut']) |
|
171 | 171 | ) { |
172 | 172 | // Set value to true, when option has no value |
173 | 173 | $value = true; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | if (func_num_args() > 1) { |
267 | 267 | return func_get_arg(1); |
268 | 268 | } else { |
269 | - throw new Exception\MissingVariableException('Missing variable ' . $name); |
|
269 | + throw new Exception\MissingVariableException('Missing variable '.$name); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | if ($parts && $value instanceof self && $value !== $this) { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $args[0] = implode('.', $parts); |
276 | 276 | return call_user_func_array(array($value, 'get'), $args); |
277 | 277 | } catch (Exception\MissingVariableException $e) { |
278 | - throw new Exception\MissingVariableException('Missing variable ' . $name); |
|
278 | + throw new Exception\MissingVariableException('Missing variable '.$name); |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | if (!$this->expression) { |
78 | 78 | throw new Exception('Missing expression'); |
79 | 79 | } |
80 | - return $this->getParent()->expand('{' . $this->expression . '}'); |
|
80 | + return $this->getParent()->expand('{'.$this->expression.'}'); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | ?> |
@@ -76,25 +76,25 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | $cwd = $this->expand($this->cwd); |
79 | - $cwdCmd = $cwd ? 'cd ' . escapeshellarg($cwd) . '; ' : null; |
|
79 | + $cwdCmd = $cwd ? 'cd '.escapeshellarg($cwd).'; ' : null; |
|
80 | 80 | $toDirParent = dirname(array_pop(explode(':', $to, 2))); |
81 | 81 | if ($toDirParent !== '/') { |
82 | - $prepareDirCmd = 'mkdir -p ' . escapeshellarg($toDirParent); |
|
82 | + $prepareDirCmd = 'mkdir -p '.escapeshellarg($toDirParent); |
|
83 | 83 | if ($toNode) { |
84 | 84 | $prepareDirCmd = $this->getSshCommand($prepareDirCmd, $toNode); |
85 | 85 | } elseif ($cwd && $toDirParent[0] !== '/') { |
86 | - $prepareDirCmd = $cwdCmd . $prepareDirCmd; |
|
86 | + $prepareDirCmd = $cwdCmd.$prepareDirCmd; |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | - $scpCommand = $this->getScpCommand($node) . ' ' . escapeshellarg($from) . ' ' . escapeshellarg($to); |
|
90 | + $scpCommand = $this->getScpCommand($node).' '.escapeshellarg($from).' '.escapeshellarg($to); |
|
91 | 91 | |
92 | 92 | if ($node) { |
93 | 93 | $this->addExpect($scpCommand, $node); |
94 | 94 | } |
95 | 95 | |
96 | 96 | if ($cwdCmd) { |
97 | - $scpCommand = $cwdCmd . $scpCommand; |
|
97 | + $scpCommand = $cwdCmd.$scpCommand; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | return isset($prepareDirCmd) ? array($prepareDirCmd, $scpCommand) : $scpCommand; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | protected function getScpCommand(Node $node) |
111 | 111 | { |
112 | - return rtrim('scp -r ' . trim($node->get('scpOptions'))); |
|
112 | + return rtrim('scp -r '.trim($node->get('scpOptions'))); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | protected function formatQuestion($question, $default = null) |
61 | 61 | { |
62 | - return '<question>' . $question . '</question> ' |
|
62 | + return '<question>'.$question.'</question> ' |
|
63 | 63 | . ($default !== null && $default !== '' ? "[{$default}] " : ''); |
64 | 64 | } |
65 | 65 |