@@ -19,7 +19,6 @@ |
||
19 | 19 | use Netresearch\Kite\Exception; |
20 | 20 | use Netresearch\Kite\Service\Config; |
21 | 21 | use Netresearch\Kite\Console\Command\JobCommand; |
22 | -use Netresearch\Kite\Service\Factory; |
|
23 | 22 | use Symfony\Component\Console\Command\Command; |
24 | 23 | use Symfony\Component\Console\Input\InputInterface; |
25 | 24 | use Symfony\Component\Console\Input\InputOption; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | list($dir, $file) = $dirAndFile; |
82 | 82 | if (is_dir($dir)) { |
83 | 83 | $app = $appName; |
84 | - $expectedFile = $dir . '/' . $file; |
|
84 | + $expectedFile = $dir.'/'.$file; |
|
85 | 85 | break; |
86 | 86 | } |
87 | 87 | } |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | } catch (\Exception $e) { |
92 | 92 | if ($app) { |
93 | 93 | $message = [ |
94 | - 'You appear to be in a ' . $app . ' root directory but', |
|
94 | + 'You appear to be in a '.$app.' root directory but', |
|
95 | 95 | 'there is no kite config file at the expected', |
96 | - 'location (' . $expectedFile . ').' |
|
96 | + 'location ('.$expectedFile.').' |
|
97 | 97 | ]; |
98 | 98 | } else { |
99 | 99 | $message = [ |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | 'The config file path is expected to be:', |
104 | 104 | ]; |
105 | 105 | foreach ($indicators as $appName => $dirAndFile) { |
106 | - $message[] = ' - "' . implode('/', $dirAndFile) . '" for ' . $appName . ' applications or'; |
|
106 | + $message[] = ' - "'.implode('/', $dirAndFile).'" for '.$appName.' applications or'; |
|
107 | 107 | } |
108 | - $message[] = ' - "' . $expectedFile . '" for any other application'; |
|
108 | + $message[] = ' - "'.$expectedFile.'" for any other application'; |
|
109 | 109 | } |
110 | 110 | $lMax = 0; |
111 | 111 | foreach ($message as $line) { |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | $lMax = $l; |
114 | 114 | } |
115 | 115 | } |
116 | - $this->output->writeln('<warning>' . str_repeat(' ', $lMax + 4) . '</warning>'); |
|
116 | + $this->output->writeln('<warning>'.str_repeat(' ', $lMax + 4).'</warning>'); |
|
117 | 117 | foreach ($message as $line) { |
118 | 118 | $line = str_pad($line, $lMax + 2); |
119 | 119 | $this->output->writeln("<warning> $line</warning>"); |
120 | 120 | } |
121 | - $this->output->writeln('<warning>' . str_repeat(' ', $lMax + 4) . '</warning>'); |
|
121 | + $this->output->writeln('<warning>'.str_repeat(' ', $lMax + 4).'</warning>'); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | . "| ' /| | __/ _ \\\n" |
136 | 136 | . "| . \\| | |_| __/\n" |
137 | 137 | . "|_|\\_|_|\\__\\___|\n\n" |
138 | - . $this->getLongVersion() . "\n\n" |
|
138 | + . $this->getLongVersion()."\n\n" |
|
139 | 139 | . $this->getSelfPackage()->description; |
140 | 140 | |
141 | 141 | return $help; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | if (isset($package->source)) { |
154 | 154 | $v .= " <comment>({$package->source->reference})</comment>"; |
155 | 155 | } |
156 | - $v .= ' ' . $package->time; |
|
156 | + $v .= ' '.$package->time; |
|
157 | 157 | return $v; |
158 | 158 | } |
159 | 159 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | { |
167 | 167 | static $package = null; |
168 | 168 | if (!$package) { |
169 | - $files = [__DIR__ . '/../../../../composer/installed.json', __DIR__ . '/vendor/composer/installed.json']; |
|
169 | + $files = [__DIR__.'/../../../../composer/installed.json', __DIR__.'/vendor/composer/installed.json']; |
|
170 | 170 | foreach ($files as $file) { |
171 | 171 | if (file_exists($file)) { |
172 | 172 | $installed = json_decode(file_get_contents($file)); |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | $process = new Process('git symbolic-ref -q --short HEAD || git describe --tags --exact-match; git rev-parse HEAD; git show -s --format=%ct HEAD', $kitePath); |
184 | 184 | $process->run(); |
185 | 185 | if ($output = $process->getOutput()) { |
186 | - $package = json_decode(file_get_contents($kitePath . '/composer.json')); |
|
186 | + $package = json_decode(file_get_contents($kitePath.'/composer.json')); |
|
187 | 187 | list($name, $revision, $tstamp) = explode("\n", trim($output), 3); |
188 | - $package->version = preg_match('/^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9]+)?$/i', $name) ? $name : 'dev-' . $name; |
|
188 | + $package->version = preg_match('/^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9]+)?$/i', $name) ? $name : 'dev-'.$name; |
|
189 | 189 | $package->source = (object) ['reference' => $revision]; |
190 | 190 | $package->time = date('Y-m-d H:i:s', $tstamp); |
191 | 191 | } else { |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $definition->addOption(new InputOption('workflow', null, InputOption::VALUE_OPTIONAL, 'Run a workflow on the fly')); |
208 | 208 | |
209 | 209 | if (isset($_SERVER['HOME']) && is_writable($_SERVER['HOME'])) { |
210 | - $debugDir = $_SERVER['HOME'] . '/.kite/log'; |
|
210 | + $debugDir = $_SERVER['HOME'].'/.kite/log'; |
|
211 | 211 | } else { |
212 | 212 | $debugDir = false; |
213 | 213 | } |
@@ -251,19 +251,19 @@ discard block |
||
251 | 251 | $strInput .= ' --help'; |
252 | 252 | } |
253 | 253 | $workflow = $input->getParameterOption('--workflow'); |
254 | - $jobName = 'generic:workflow:' . $workflow; |
|
254 | + $jobName = 'generic:workflow:'.$workflow; |
|
255 | 255 | $this->config->configureJob($jobName, array('workflow' => $workflow)); |
256 | 256 | $command = new JobCommand($jobName, $this->config); |
257 | 257 | $this->add($command); |
258 | 258 | |
259 | - $parameterOption = '--workflow=' . $workflow; |
|
259 | + $parameterOption = '--workflow='.$workflow; |
|
260 | 260 | $input = new StringInput( |
261 | 261 | rtrim( |
262 | - $jobName . ' ' . |
|
262 | + $jobName.' '. |
|
263 | 263 | str_replace( |
264 | 264 | array( |
265 | - $parameterOption . ' ', |
|
266 | - ' ' . $parameterOption, |
|
265 | + $parameterOption.' ', |
|
266 | + ' '.$parameterOption, |
|
267 | 267 | $parameterOption |
268 | 268 | ), '', $strInput |
269 | 269 | ) |
@@ -22,7 +22,6 @@ |
||
22 | 22 | use Netresearch\Kite\Service\Descriptor; |
23 | 23 | use Symfony\Component\Console\Command\Command; |
24 | 24 | use Symfony\Component\Console\Input\InputInterface; |
25 | - |
|
26 | 25 | use Symfony\Component\Console\Output\ConsoleOutput; |
27 | 26 | use Symfony\Component\Console\Output\OutputInterface; |
28 | 27 |
@@ -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 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | /** |
29 | 29 | * ConsoleOutput constructor. |
30 | 30 | * |
31 | - * @param int|mixed $verbosity The verbosity |
|
31 | + * @param integer $verbosity The verbosity |
|
32 | 32 | * @param boolean $decorated If output should be decorated |
33 | 33 | * @param OutputFormatterInterface|null $formatter Formatter |
34 | 34 | */ |
@@ -13,7 +13,6 @@ |
||
13 | 13 | |
14 | 14 | namespace Netresearch\Kite\Console\Output; |
15 | 15 | use Symfony\Component\Console\Formatter\OutputFormatterInterface; |
16 | - |
|
17 | 16 | use Symfony\Component\Console\Output\StreamOutput; |
18 | 17 | use Symfony\Component\Console\Formatter\OutputFormatterStyle; |
19 | 18 |
@@ -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 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * Constructor. |
54 | 54 | * |
55 | - * @param mixed $stream A stream resource |
|
55 | + * @param resource $stream A stream resource |
|
56 | 56 | * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) |
57 | 57 | * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) |
58 | 58 | * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | /** |
131 | 131 | * Write to output |
132 | 132 | * |
133 | - * @param array|string $messages Messages |
|
133 | + * @param string $messages Messages |
|
134 | 134 | * @param bool $newline Whether to append a newline |
135 | 135 | * @param int $type The output type |
136 | 136 | * |
@@ -15,7 +15,6 @@ |
||
15 | 15 | namespace Netresearch\Kite\Service; |
16 | 16 | use Netresearch\Kite\Job; |
17 | 17 | use Netresearch\Kite\Service\Composer\Package; |
18 | -use Netresearch\Kite\Task; |
|
19 | 18 | use Netresearch\Kite\Exception; |
20 | 19 | use Netresearch\Kite\Tasks; |
21 | 20 |
@@ -15,7 +15,6 @@ |
||
15 | 15 | namespace Netresearch\Kite\Service; |
16 | 16 | |
17 | 17 | use Netresearch\Kite\Console\Output\Output; |
18 | - |
|
19 | 18 | use Symfony\Component\Console\Application; |
20 | 19 | use Symfony\Component\Console\Helper; |
21 | 20 | use Symfony\Component\Console\Input\InputInterface; |
@@ -12,7 +12,6 @@ |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | namespace Netresearch\Kite\Service; |
15 | -use Netresearch\Kite\Exception; |
|
16 | 15 | use Netresearch\Kite\Task; |
17 | 16 | |
18 | 17 | /** |
@@ -44,11 +44,11 @@ |
||
44 | 44 | $taskProperty = new \ReflectionProperty('Netresearch\\Kite\\Tasks', 'tasks'); |
45 | 45 | $taskProperty->setAccessible(true); |
46 | 46 | foreach ($taskProperty->getValue($task) as $subTask) { |
47 | - $description .= "\n\n" . $this->describeTask($subTask); |
|
47 | + $description .= "\n\n".$this->describeTask($subTask); |
|
48 | 48 | } |
49 | 49 | $description = trim($description); |
50 | 50 | if (!$description) { |
51 | - $description = 'Generic ' . $reflection->getName(); |
|
51 | + $description = 'Generic '.$reflection->getName(); |
|
52 | 52 | } |
53 | 53 | } elseif (preg_match_all('/^ \* ([^@ \n].+|)$/mU', $reflection->getDocComment(), $matches, PREG_PATTERN_ORDER)) { |
54 | 54 | $description = trim(implode("\n", $matches[1])); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | /** |
66 | 66 | * Run the task |
67 | 67 | * |
68 | - * @return mixed |
|
68 | + * @return null|string |
|
69 | 69 | */ |
70 | 70 | public function run() |
71 | 71 | { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | if ($name === 'command') { |
59 | 59 | parent::offsetSet('composerCommand', $value); |
60 | - $value = 'composer ' . $value; |
|
60 | + $value = 'composer '.$value; |
|
61 | 61 | } |
62 | 62 | parent::offsetSet($name, $value); |
63 | 63 | } |
@@ -84,19 +84,19 @@ discard block |
||
84 | 84 | protected function getCommand() |
85 | 85 | { |
86 | 86 | $cmd = $this->get('command'); |
87 | - $argv = substr(parent::getCommand(), strlen($cmd)) . ' '; |
|
87 | + $argv = substr(parent::getCommand(), strlen($cmd)).' '; |
|
88 | 88 | if (strpos($argv, ' --no-ansi ') === false |
89 | 89 | && strpos($argv, ' --ansi ') === false |
90 | 90 | && $this->console->getOutput()->isDecorated() |
91 | 91 | ) { |
92 | - $argv = ' --ansi' . $argv; |
|
92 | + $argv = ' --ansi'.$argv; |
|
93 | 93 | } |
94 | 94 | if (!$this->shouldExecute() |
95 | 95 | && strpos($argv, ' --dry-run ') === false |
96 | 96 | ) { |
97 | - $argv = ' --dry-run' . $argv; |
|
97 | + $argv = ' --dry-run'.$argv; |
|
98 | 98 | } |
99 | - return $cmd . rtrim($argv); |
|
99 | + return $cmd.rtrim($argv); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | ?> |
@@ -15,7 +15,6 @@ |
||
15 | 15 | namespace Netresearch\Kite\Task; |
16 | 16 | |
17 | 17 | |
18 | -use Netresearch\Kite\Exception; |
|
19 | 18 | use Netresearch\Kite\Task; |
20 | 19 | |
21 | 20 | /** |