@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $files = $this->get('files'); |
71 | 71 | if (is_string($files)) { |
72 | - $files = array_filter(preg_split('#[\n' . PATH_SEPARATOR . ',]#', $files)); |
|
72 | + $files = array_filter(preg_split('#[\n'.PATH_SEPARATOR.',]#', $files)); |
|
73 | 73 | } |
74 | 74 | if (!is_array($files) && !$files instanceof \Traversable) { |
75 | 75 | throw new \Netresearch\Kite\Exception('files must be traversable'); |
@@ -88,22 +88,22 @@ discard block |
||
88 | 88 | $filesystem = $this->console->getFilesystem(); |
89 | 89 | $dir = dirname($this->get('toFile')); |
90 | 90 | $filesystem->ensureDirectoryExists($dir); |
91 | - $cmd = 'tar -rf ' . escapeshellarg($this->get('toFile')) . ' '; |
|
91 | + $cmd = 'tar -rf '.escapeshellarg($this->get('toFile')).' '; |
|
92 | 92 | |
93 | 93 | if ($this->get('tmpCopy', true)) { |
94 | - $tmpFolder = basename($this->get('toFile')) . '-' . uniqid(); |
|
94 | + $tmpFolder = basename($this->get('toFile')).'-'.uniqid(); |
|
95 | 95 | $filesystem->ensureDirectoryExists($tmpFolder); |
96 | 96 | |
97 | 97 | foreach ($this->getFiles() as $file) { |
98 | - $filesystem->copy($file, $tmpFolder . '/' . $file); |
|
98 | + $filesystem->copy($file, $tmpFolder.'/'.$file); |
|
99 | 99 | } |
100 | 100 | |
101 | - $this->console->createProcess($cmd . ' -C ' . escapeshellarg($tmpFolder) . ' .')->run(); |
|
101 | + $this->console->createProcess($cmd.' -C '.escapeshellarg($tmpFolder).' .')->run(); |
|
102 | 102 | |
103 | 103 | $filesystem->remove($tmpFolder); |
104 | 104 | } else { |
105 | 105 | foreach ($this->getFiles() as $file) { |
106 | - $this->console->createProcess($cmd . escapeshellarg($file))->run(); |
|
106 | + $this->console->createProcess($cmd.escapeshellarg($file))->run(); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | } |
@@ -39,10 +39,10 @@ |
||
39 | 39 | if ($name === 'command') { |
40 | 40 | if (is_array($value)) { |
41 | 41 | foreach ($value as &$item) { |
42 | - $item = 'git ' . $item; |
|
42 | + $item = 'git '.$item; |
|
43 | 43 | } |
44 | 44 | } else { |
45 | - $value = 'git ' . $value; |
|
45 | + $value = 'git '.$value; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | parent::offsetSet($name, $value); |
@@ -113,7 +113,7 @@ |
||
113 | 113 | foreach (array('key', 'value') as $name) { |
114 | 114 | if ($$name) { |
115 | 115 | if ($this->has($$name)) { |
116 | - throw new Exception('Variable ' . $$name . ' is already present'); |
|
116 | + throw new Exception('Variable '.$$name.' is already present'); |
|
117 | 117 | } |
118 | 118 | $this->as[$name] = $$name; |
119 | 119 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $code = "<?php\n"; |
88 | 88 | foreach (array('to', 'from', 'filter', 'cliStub', 'webStub', 'alias', 'metadata') as $var) { |
89 | 89 | $value = $this->get($var); |
90 | - $code .= '$' . $var . " = unserialize('" . serialize($value) . "');\n"; |
|
90 | + $code .= '$'.$var." = unserialize('".serialize($value)."');\n"; |
|
91 | 91 | } |
92 | 92 | $code .= ' |
93 | 93 | $phar = new \Phar($to); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | list($dir, $file) = $dirAndFile; |
81 | 81 | if (is_dir($dir)) { |
82 | 82 | $app = $appName; |
83 | - $expectedFile = $dir . '/' . $file; |
|
83 | + $expectedFile = $dir.'/'.$file; |
|
84 | 84 | break; |
85 | 85 | } |
86 | 86 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | } catch (\Exception $e) { |
91 | 91 | if ($app) { |
92 | 92 | $message = [ |
93 | - 'You appear to be in a ' . $app . ' root directory but', |
|
93 | + 'You appear to be in a '.$app.' root directory but', |
|
94 | 94 | 'there is no kite config file at the expected', |
95 | - 'location (' . $expectedFile . ').' |
|
95 | + 'location ('.$expectedFile.').' |
|
96 | 96 | ]; |
97 | 97 | } else { |
98 | 98 | $message = [ |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | 'The config file path is expected to be:', |
103 | 103 | ]; |
104 | 104 | foreach ($indicators as $appName => $dirAndFile) { |
105 | - $message[] = ' - "' . implode('/', $dirAndFile) . '" for ' . $appName . ' applications or'; |
|
105 | + $message[] = ' - "'.implode('/', $dirAndFile).'" for '.$appName.' applications or'; |
|
106 | 106 | } |
107 | - $message[] = ' - "' . $expectedFile . '" for any other application'; |
|
107 | + $message[] = ' - "'.$expectedFile.'" for any other application'; |
|
108 | 108 | } |
109 | 109 | $lMax = 0; |
110 | 110 | foreach ($message as $line) { |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | $lMax = $l; |
113 | 113 | } |
114 | 114 | } |
115 | - $this->output->writeln('<warning>' . str_repeat(' ', $lMax + 4) . '</warning>'); |
|
115 | + $this->output->writeln('<warning>'.str_repeat(' ', $lMax + 4).'</warning>'); |
|
116 | 116 | foreach ($message as $line) { |
117 | 117 | $line = str_pad($line, $lMax + 2); |
118 | 118 | $this->output->writeln("<warning> $line</warning>"); |
119 | 119 | } |
120 | - $this->output->writeln('<warning>' . str_repeat(' ', $lMax + 4) . '</warning>'); |
|
120 | + $this->output->writeln('<warning>'.str_repeat(' ', $lMax + 4).'</warning>'); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | . "| ' /| | __/ _ \\\n" |
135 | 135 | . "| . \\| | |_| __/\n" |
136 | 136 | . "|_|\\_|_|\\__\\___|\n\n" |
137 | - . $this->getLongVersion() . "\n\n" |
|
137 | + . $this->getLongVersion()."\n\n" |
|
138 | 138 | . $this->getSelfPackage()->description; |
139 | 139 | |
140 | 140 | return $help; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | if (isset($package->source)) { |
153 | 153 | $v .= " <comment>({$package->source->reference})</comment>"; |
154 | 154 | } |
155 | - $v .= ' ' . $package->time; |
|
155 | + $v .= ' '.$package->time; |
|
156 | 156 | return $v; |
157 | 157 | } |
158 | 158 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | { |
166 | 166 | static $package = null; |
167 | 167 | if (!$package) { |
168 | - $files = [__DIR__ . '/../../../../composer/installed.json', __DIR__ . '/vendor/composer/installed.json']; |
|
168 | + $files = [__DIR__.'/../../../../composer/installed.json', __DIR__.'/vendor/composer/installed.json']; |
|
169 | 169 | foreach ($files as $file) { |
170 | 170 | if (file_exists($file)) { |
171 | 171 | $installed = json_decode(file_get_contents($file)); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $definition->addOption(new InputOption('workflow', null, InputOption::VALUE_OPTIONAL, 'Run a workflow on the fly')); |
196 | 196 | |
197 | 197 | if (isset($_SERVER['HOME']) && is_writable($_SERVER['HOME'])) { |
198 | - $debugDir = $_SERVER['HOME'] . '/.kite/log'; |
|
198 | + $debugDir = $_SERVER['HOME'].'/.kite/log'; |
|
199 | 199 | } else { |
200 | 200 | $debugDir = false; |
201 | 201 | } |
@@ -239,19 +239,19 @@ discard block |
||
239 | 239 | $strInput .= ' --help'; |
240 | 240 | } |
241 | 241 | $workflow = $input->getParameterOption('--workflow'); |
242 | - $jobName = 'generic:workflow:' . $workflow; |
|
242 | + $jobName = 'generic:workflow:'.$workflow; |
|
243 | 243 | $this->config->configureJob($jobName, array('workflow' => $workflow)); |
244 | 244 | $command = new JobCommand($jobName, $this->config); |
245 | 245 | $this->add($command); |
246 | 246 | |
247 | - $parameterOption = '--workflow=' . $workflow; |
|
247 | + $parameterOption = '--workflow='.$workflow; |
|
248 | 248 | $input = new StringInput( |
249 | 249 | rtrim( |
250 | - $jobName . ' ' . |
|
250 | + $jobName.' '. |
|
251 | 251 | str_replace( |
252 | 252 | array( |
253 | - $parameterOption . ' ', |
|
254 | - ' ' . $parameterOption, |
|
253 | + $parameterOption.' ', |
|
254 | + ' '.$parameterOption, |
|
255 | 255 | $parameterOption |
256 | 256 | ), '', $strInput |
257 | 257 | ) |
@@ -149,10 +149,10 @@ |
||
149 | 149 | $newline = true; |
150 | 150 | } |
151 | 151 | if ($this->previousWasNewLine && $l >= 0 && $message[0] !== "\n") { |
152 | - $message = $this->getIndention() . $message; |
|
152 | + $message = $this->getIndention().$message; |
|
153 | 153 | } |
154 | 154 | if (strpos($message, "\n") !== false) { |
155 | - $message = str_replace("\n", "\n" . $this->getIndention(), $message); |
|
155 | + $message = str_replace("\n", "\n".$this->getIndention(), $message); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | // TODO: Indent wrapped lines - that's just not that easy because of the ANSI color escape codes |
@@ -72,7 +72,7 @@ |
||
72 | 72 | if (!is_dir($dir)) { |
73 | 73 | throw new Exception("Debug dir $dir doesn't exist"); |
74 | 74 | } |
75 | - $files = glob($dir . '/*'); |
|
75 | + $files = glob($dir.'/*'); |
|
76 | 76 | if ($input->getOption('list')) { |
77 | 77 | foreach ($files as $file) { |
78 | 78 | $output->writeln(basename($file)); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | . "from kite configuration:\n\n" |
145 | 145 | . $this->getHelper('formatter')->formatBlock($this->getDescription(), 'fg=black;bg=green', true) |
146 | 146 | . "\n\nThe canonicalized command is:\n\n" |
147 | - . " <info>php " . $_SERVER['PHP_SELF'] . ' ' . preg_replace('/^generic:([^:]+):([^ ]+)/', '--$1=$2', $this->getName()) . "</info>\n"; |
|
147 | + . " <info>php ".$_SERVER['PHP_SELF'].' '.preg_replace('/^generic:([^:]+):([^ ]+)/', '--$1=$2', $this->getName())."</info>\n"; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -178,13 +178,13 @@ discard block |
||
178 | 178 | if (!$input->getOption('no-debug-file') && $debugDir = $input->getOption('debug-dir')) { |
179 | 179 | $this->console->getFilesystem()->ensureDirectoryExists($debugDir); |
180 | 180 | // keep max 20 logs |
181 | - $files = glob($debugDir . '/*'); |
|
181 | + $files = glob($debugDir.'/*'); |
|
182 | 182 | while (count($files) > 19) { |
183 | 183 | $this->console->getFilesystem()->remove(array_shift($files)); |
184 | 184 | } |
185 | 185 | $logFile = date('YmdHis'); |
186 | 186 | $debugOutput = new Output( |
187 | - fopen(rtrim($debugDir, '\\/') . '/' . $logFile, 'w'), |
|
187 | + fopen(rtrim($debugDir, '\\/').'/'.$logFile, 'w'), |
|
188 | 188 | Output::VERBOSITY_VERY_VERBOSE, |
189 | 189 | true |
190 | 190 | ); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $debugOutput->writeln( |
194 | 194 | $this->getHelper('formatter')->formatBlock( |
195 | 195 | implode(' ', $_SERVER['argv']), 'fg=black;bg=white', true |
196 | - ) . "\n" |
|
196 | + )."\n" |
|
197 | 197 | ); |
198 | 198 | } |
199 | 199 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } catch (\Exception $e) { |
224 | 224 | if ($e instanceof ExitException && $e->getCode() === 0) { |
225 | 225 | if ($e->getMessage()) { |
226 | - $output->writeln('<info>' . $e->getMessage() . '</info>'); |
|
226 | + $output->writeln('<info>'.$e->getMessage().'</info>'); |
|
227 | 227 | } |
228 | 228 | return 0; |
229 | 229 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | if (!$name) { |
284 | 284 | return 0; |
285 | 285 | } |
286 | - $key = $type . ':' . $name; |
|
286 | + $key = $type.':'.$name; |
|
287 | 287 | $tasksAdded = 0; |
288 | 288 | if (array_key_exists($key, $this->job->deferredTasks)) { |
289 | 289 | while ($task = array_shift($this->job->deferredTasks[$key])) { |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $shouldRun = $if; |
311 | 311 | } elseif (is_string($if)) { |
312 | 312 | $shouldRun = (boolean) $task->expand( |
313 | - '{' . $if . ' ? 1 : 0}' |
|
313 | + '{'.$if.' ? 1 : 0}' |
|
314 | 314 | ); |
315 | 315 | } else { |
316 | 316 | $shouldRun = call_user_func_array($if, array($task, $this->console)); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | if ($name === '@self') { |
350 | 350 | $name = $this->get('name'); |
351 | 351 | } |
352 | - $key = $type . ':' . $name; |
|
352 | + $key = $type.':'.$name; |
|
353 | 353 | $this->job->deferredTasks[$key][] = $task; |
354 | 354 | } |
355 | 355 | } |