@@ -13,12 +13,9 @@ |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Workflow; |
16 | -use Netresearch\Kite\Service\Factory; |
|
17 | 16 | use Netresearch\Kite\Task; |
18 | - |
|
19 | 17 | use Netresearch\Kite\Workflow; |
20 | 18 | use Netresearch\Kite\Exception; |
21 | - |
|
22 | 19 | use Symfony\Component\Console\Output\OutputInterface; |
23 | 20 | |
24 | 21 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | public function assemble() |
132 | 132 | { |
133 | 133 | $this->callback( |
134 | - function () { |
|
134 | + function() { |
|
135 | 135 | $stages = $this->get('stages'); |
136 | 136 | $stageOptions = array(); |
137 | 137 | // Begin keys from 1 |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $task = clone $this->task; |
177 | 177 | foreach ($stages[$stage] as $key => $value) { |
178 | 178 | // Avoid variables overriding parent variables, by prefixing with this |
179 | - $task->set('this.' . $key, $value); |
|
179 | + $task->set('this.'.$key, $value); |
|
180 | 180 | } |
181 | 181 | $this->addTask($task); |
182 | 182 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | ], |
50 | 50 | 'task' => [ |
51 | 51 | 'type' => 'callback', |
52 | - 'callback' => function (\Netresearch\Kite\Job $job) { |
|
52 | + 'callback' => function(\Netresearch\Kite\Job $job) { |
|
53 | 53 | $git = $job->get('git'); |
54 | 54 | $command = $job->get('cmd'); |
55 | 55 | foreach ($job->get('composer.packages') as $package) { |
@@ -172,10 +172,10 @@ |
||
172 | 172 | } |
173 | 173 | if ($isTest) { |
174 | 174 | if ($isFunctionCall) { |
175 | - throw new SyntaxError('Can\'t use function return value in write context', $stream->current->cursor); |
|
175 | + throw new SyntaxError('Can\'t use function return value in write context', $stream->current->cursor); |
|
176 | 176 | } |
177 | 177 | if (!$stream->current->test(Token::PUNCTUATION_TYPE, ')')) { |
178 | - throw new SyntaxError('Expected )', $stream->current->cursor); |
|
178 | + throw new SyntaxError('Expected )', $stream->current->cursor); |
|
179 | 179 | } |
180 | 180 | $tokens[] = new Token(Token::STRING_TYPE, implode('.', $names), $token->cursor); |
181 | 181 | } else { |
@@ -51,7 +51,7 @@ |
||
51 | 51 | public function execute() |
52 | 52 | { |
53 | 53 | ob_start( |
54 | - function ($output) { |
|
54 | + function($output) { |
|
55 | 55 | $this->console->output($output, false); |
56 | 56 | return ''; |
57 | 57 | }, 2, 0 |
@@ -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; |
@@ -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 | } |
@@ -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; |
@@ -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 | * |
@@ -14,7 +14,6 @@ |
||
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Workflow\Composer; |
16 | 16 | use Netresearch\Kite\Service\Composer\Package; |
17 | -use Netresearch\Kite\Task; |
|
18 | 17 | use Netresearch\Kite\Workflow; |
19 | 18 | |
20 | 19 |
@@ -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 | /** |
@@ -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])); |
@@ -136,7 +136,7 @@ |
||
136 | 136 | /** |
137 | 137 | * Execute the command |
138 | 138 | * |
139 | - * @return mixed |
|
139 | + * @return null|string |
|
140 | 140 | */ |
141 | 141 | protected function executeCommand() |
142 | 142 | { |
@@ -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 | ?> |