@@ -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 | ?> |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function assemble() |
61 | 61 | { |
62 | 62 | $this->callback( |
63 | - function () { |
|
63 | + function() { |
|
64 | 64 | $this->findLoaders(); |
65 | 65 | $file = $this->get('file'); |
66 | 66 | $this->console->getFilesystem()->ensureDirectoryExists(dirname($file)); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | foreach (['task', 'workflow'] as $type) { |
111 | 111 | $lines[] = ''; |
112 | - $lines[] = ucfirst($type) . 's'; |
|
112 | + $lines[] = ucfirst($type).'s'; |
|
113 | 113 | $lines[] = str_repeat('=', strlen($type) + 1); |
114 | 114 | $lines[] = ''; |
115 | 115 | $taskObjects = $this->loadTaskObjects($type); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $lines[] = 'Options'; |
140 | 140 | $lines[] = '```````'; |
141 | 141 | $lines[] = ''; |
142 | - $this->renderVariables($lines, $taskVariables, $type . '-' . $name); |
|
142 | + $this->renderVariables($lines, $taskVariables, $type.'-'.$name); |
|
143 | 143 | } |
144 | 144 | if ($taskCommonVariables) { |
145 | 145 | $lines[] = 'Common options'; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $keys = ['type', 'default', 'required', 'label']; |
176 | 176 | $lines[] = ' * - Name'; |
177 | 177 | foreach ($keys as $key) { |
178 | - $lines[] = ' - ' . ucfirst($key); |
|
178 | + $lines[] = ' - '.ucfirst($key); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | foreach ($variables as $configName => $config) { |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | } |
185 | 185 | $lines[] = ' * - '; |
186 | 186 | $lines[] = ''; |
187 | - $lines[] = ' .. |' . $anchorPrefix . '-' . $configName . '| replace:: ' . $configName; |
|
187 | + $lines[] = ' .. |'.$anchorPrefix.'-'.$configName.'| replace:: '.$configName; |
|
188 | 188 | $lines[] = ''; |
189 | - $lines[] = ' .. _' . $anchorPrefix . '-' . $configName . ':'; |
|
189 | + $lines[] = ' .. _'.$anchorPrefix.'-'.$configName.':'; |
|
190 | 190 | $lines[] = ''; |
191 | - $lines[] = ' ' . $configName; |
|
191 | + $lines[] = ' '.$configName; |
|
192 | 192 | $lines[] = ''; |
193 | 193 | foreach ($keys as $key) { |
194 | 194 | if (!array_key_exists($key, $config)) { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $v = $config[$key]; |
198 | 198 | $value = $v === null ? 'null' : ($v === true ? 'true' : ($v === false ? 'false' : $v)); |
199 | 199 | if (is_string($value)) { |
200 | - $value = ':code:`' . $value . '`'; |
|
200 | + $value = ':code:`'.$value.'`'; |
|
201 | 201 | } |
202 | 202 | } elseif ($key === 'required') { |
203 | 203 | $value = $config[$key] === true ? 'X' : $config[$key]; |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | $value = $config[$key]; |
206 | 206 | } |
207 | 207 | if (is_array($value)) { |
208 | - $value = "\n\n .. code::php\n\n " . str_replace("\n", "\n\n ", call_user_func('print' . '_r', $value, true)) . "\n\n"; |
|
208 | + $value = "\n\n .. code::php\n\n ".str_replace("\n", "\n\n ", call_user_func('print'.'_r', $value, true))."\n\n"; |
|
209 | 209 | } else { |
210 | 210 | $value = str_replace("\n", "\n\n ", $value); |
211 | 211 | } |
212 | - $value = preg_replace('/\{@see\s+(' . implode('|', array_keys($variables)) . ')\}/', '|' . $anchorPrefix . '-$1|_', $value); |
|
213 | - $lines[] = ' - ' . $value; |
|
212 | + $value = preg_replace('/\{@see\s+('.implode('|', array_keys($variables)).')\}/', '|'.$anchorPrefix.'-$1|_', $value); |
|
213 | + $lines[] = ' - '.$value; |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | $lines[] = ''; |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | { |
226 | 226 | static $commonVars; |
227 | 227 | if (!is_array($commonVars)) { |
228 | - $className = 'NetresearchKiteTask' . uniqid(); |
|
229 | - eval('class ' . $className . ' extends \\Netresearch\\Kite\\Task {}'); |
|
228 | + $className = 'NetresearchKiteTask'.uniqid(); |
|
229 | + eval('class '.$className.' extends \\Netresearch\\Kite\\Task {}'); |
|
230 | 230 | $instance = new $className($this); |
231 | 231 | $commonVars = $instance->get('_variableConfiguration'); |
232 | 232 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | protected function loadTaskObjects($type) |
244 | 244 | { |
245 | 245 | $objects = []; |
246 | - $requiredType = 'Netresearch\\Kite\\' . ucfirst($type); |
|
246 | + $requiredType = 'Netresearch\\Kite\\'.ucfirst($type); |
|
247 | 247 | foreach ($this->factory->getNamespaces($type) as $namespace) { |
248 | 248 | $namespaceLength = strlen($namespace); |
249 | 249 | if ($dir = $this->findDirectoryForNamespace($namespace)) { |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | if (substr($file, -4) !== '.php') { |
252 | 252 | continue; |
253 | 253 | } |
254 | - $class = $namespace . '\\' . substr(strtr($file, '/', '\\'), 0, -4); |
|
254 | + $class = $namespace.'\\'.substr(strtr($file, '/', '\\'), 0, -4); |
|
255 | 255 | $reflectionClass = new \ReflectionClass($class); |
256 | 256 | if (!$reflectionClass->isSubclassOf($requiredType) || !$reflectionClass->isInstantiable()) { |
257 | 257 | continue; |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | continue; |
339 | 339 | } |
340 | 340 | foreach ($dirs as $dir) { |
341 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { |
|
341 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $length))) { |
|
342 | 342 | return $file; |
343 | 343 | } |
344 | 344 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | |
347 | 347 | // PSR-4 fallback dirs |
348 | 348 | foreach ($loader->getFallbackDirsPsr4() as $dir) { |
349 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
349 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
350 | 350 | return $file; |
351 | 351 | } |
352 | 352 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | foreach ($loader->getPrefixes() as $prefix => $dirs) { |
365 | 365 | if (0 === strpos($namespace, $prefix)) { |
366 | 366 | foreach ($dirs as $dir) { |
367 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
367 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
368 | 368 | return $file; |
369 | 369 | } |
370 | 370 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | |
374 | 374 | // PSR-0 fallback dirs |
375 | 375 | foreach ($loader->getFallbackDirs() as $dir) { |
376 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
376 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
377 | 377 | return $file; |
378 | 378 | } |
379 | 379 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $this->git('push', $package->path, array('u' => 'origin', $package->branch)); |
93 | 93 | $this->console->output( |
94 | 94 | str_repeat(chr(8), strlen($package->name)) |
95 | - . '<info>' . $package->name . '</info>' |
|
95 | + . '<info>'.$package->name.'</info>' |
|
96 | 96 | ); |
97 | 97 | unset($this->pushPackages[$i]); |
98 | 98 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $unfixedRequirements = 0; |
137 | 137 | while ($packageName = array_shift($checkedOutPackages)) { |
138 | 138 | $branch = $packages[$packageName]->branch; |
139 | - $version = 'dev-' . $branch; |
|
139 | + $version = 'dev-'.$branch; |
|
140 | 140 | foreach ($this->getPackages(false, false) as $package) { |
141 | 141 | if (array_key_exists($packageName, $package->requires)) { |
142 | 142 | // TODO: Set required version to branch alias, if any |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $this->assertPackageAllowed($package); |
195 | 195 | |
196 | 196 | $currentVersion = $package->requires[$requiredPackage]; |
197 | - $composerFile = $package->path . '/composer.json'; |
|
197 | + $composerFile = $package->path.'/composer.json'; |
|
198 | 198 | $composerFileContents = file_get_contents($composerFile); |
199 | 199 | $newComposerFileContents = preg_replace( |
200 | 200 | sprintf( |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | preg_quote($requiredPackage, '/'), |
203 | 203 | preg_quote($currentVersion, '/') |
204 | 204 | ), |
205 | - '$1' . $newVersion, |
|
205 | + '$1'.$newVersion, |
|
206 | 206 | $composerFileContents |
207 | 207 | ); |
208 | 208 | file_put_contents($composerFile, $newComposerFileContents); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | protected function reloadRequires($package) |
239 | 239 | { |
240 | - $file = $package->path . '/composer.json'; |
|
240 | + $file = $package->path.'/composer.json'; |
|
241 | 241 | if (file_exists($file)) { |
242 | 242 | $composerJson = json_decode(file_get_contents($file)); |
243 | 243 | $package->requires = isset($composerJson->require) ? get_object_vars($composerJson->require) : array(); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | if (!$package->git) { |
264 | 264 | throw new Exception('Non git package can not be checked out'); |
265 | 265 | } |
266 | - $remoteBranch = 'origin/' . $branch; |
|
266 | + $remoteBranch = 'origin/'.$branch; |
|
267 | 267 | $isRemote = in_array($remoteBranch, $package->branches, true); |
268 | 268 | if (in_array($branch, $package->branches, true)) { |
269 | 269 | $this->git('checkout', $package->path, $branch); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | } elseif ($create) { |
273 | 273 | $branches = array_unique( |
274 | 274 | array_map( |
275 | - function ($el) { |
|
275 | + function($el) { |
|
276 | 276 | $parts = explode('/', $el); |
277 | 277 | return array_pop($parts); |
278 | 278 | }, |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $this->console->output("Checked out <comment>{$package->name}</comment> at <comment>$branch</comment>"); |
305 | 305 | |
306 | 306 | $this->reloadRequires($package); |
307 | - $package->version = 'dev-' . $branch; |
|
307 | + $package->version = 'dev-'.$branch; |
|
308 | 308 | $package->branch = $branch; |
309 | 309 | |
310 | 310 | return true; |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | throw new Exception('Non git package can not be merged'); |
329 | 329 | } |
330 | 330 | |
331 | - $this->git('fetch', $package->path, array('force' => true, 'origin', $branch . ':' . $branch)); |
|
331 | + $this->git('fetch', $package->path, array('force' => true, 'origin', $branch.':'.$branch)); |
|
332 | 332 | |
333 | 333 | $ff = $branch == 'master' ? 'ff' : 'no-ff'; |
334 | 334 | $optArg = array($ff => true, 'no-commit' => true); |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | if (!$message) { |
363 | 363 | $message = $this->answer( |
364 | 364 | 'Enter commit message:', |
365 | - 'Merged ' . $branch . ' into ' . $package->branch |
|
365 | + 'Merged '.$branch.' into '.$package->branch |
|
366 | 366 | ); |
367 | 367 | } |
368 | 368 | $this->git('commit', $package->path, array('n' => true, 'm' => $message)); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | private function resolveRequirementsConflict($package) |
385 | 385 | { |
386 | - $contents = file_get_contents($package->path . '/composer.json'); |
|
386 | + $contents = file_get_contents($package->path.'/composer.json'); |
|
387 | 387 | $ours = @json_decode( |
388 | 388 | preg_replace('/^<{7}.+\n(.+)\n(\|{7}|={7}).+>{7}.+$/smU', '$1', $contents) |
389 | 389 | ); |
@@ -404,16 +404,16 @@ discard block |
||
404 | 404 | } |
405 | 405 | |
406 | 406 | preg_match('/\{[^\{]*<{7}.+?>{7}[^\{]*([\t ]*)\}/smU', $contents, $matches, PREG_OFFSET_CAPTURE); |
407 | - $prefix = "\n" . str_repeat($matches[1][0], 2); |
|
407 | + $prefix = "\n".str_repeat($matches[1][0], 2); |
|
408 | 408 | $requireBlock = ''; |
409 | 409 | foreach ($this->mergeRequirements($package, $ours, $theirs) as $packageName => $version) { |
410 | - $requireBlock .= $prefix . '"' . $packageName . '": "' . $version . '",'; |
|
410 | + $requireBlock .= $prefix.'"'.$packageName.'": "'.$version.'",'; |
|
411 | 411 | } |
412 | 412 | file_put_contents( |
413 | - $package->path . '/composer.json', |
|
414 | - substr($contents, 0, $matches[0][1]) . '{' |
|
415 | - . rtrim($requireBlock, ',') . "\n" |
|
416 | - . $matches[1][0] . '}' |
|
413 | + $package->path.'/composer.json', |
|
414 | + substr($contents, 0, $matches[0][1]).'{' |
|
415 | + . rtrim($requireBlock, ',')."\n" |
|
416 | + . $matches[1][0].'}' |
|
417 | 417 | . substr($contents, $matches[0][1] + strlen($matches[0][0])) |
418 | 418 | ); |
419 | 419 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $theirsRequire = isset($theirs['require']) && is_object($theirs['require']) ? get_object_vars($theirs['require']) : []; |
434 | 434 | $mergedRequires = array_merge($oursRequire, $theirsRequire); |
435 | 435 | $packages = $this->getPackages(false, false); |
436 | - $preferredVersion = 'dev-' . $package->branch; |
|
436 | + $preferredVersion = 'dev-'.$package->branch; |
|
437 | 437 | foreach ($mergedRequires as $packageName => $version) { |
438 | 438 | $actualVersion = ($version === '@dev') ? 'dev-master' : $version; |
439 | 439 | if (array_key_exists($packageName, $oursRequire) |
@@ -499,9 +499,9 @@ discard block |
||
499 | 499 | if (!is_array($this->whitelists)) { |
500 | 500 | $this->whitelists = []; |
501 | 501 | foreach ($whitelistTypes as $whitelistType) { |
502 | - $option = $this->get('whitelist' . ucfirst($whitelistType) . 's'); |
|
502 | + $option = $this->get('whitelist'.ucfirst($whitelistType).'s'); |
|
503 | 503 | if ($option) { |
504 | - $this->whitelists[$whitelistType] = '#^' . $option . '$#'; |
|
504 | + $this->whitelists[$whitelistType] = '#^'.$option.'$#'; |
|
505 | 505 | } |
506 | 506 | } |
507 | 507 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function assemble() |
67 | 67 | { |
68 | 68 | $this->callback( |
69 | - function () { |
|
69 | + function() { |
|
70 | 70 | $this->checkoutPackages( |
71 | 71 | (array) $this->get('branch'), |
72 | 72 | $this->get('merge'), |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | $lastBranch = array_pop($branches); |
110 | 110 | $message = 'Could not find branch '; |
111 | 111 | if ($branches) { |
112 | - $message .= implode(', ', $branches) . ' or '; |
|
112 | + $message .= implode(', ', $branches).' or '; |
|
113 | 113 | } |
114 | - $message .= $lastBranch . ' in any installed package'; |
|
114 | + $message .= $lastBranch.' in any installed package'; |
|
115 | 115 | $this->console->output("<warning>$message</warning>"); |
116 | 116 | return; |
117 | 117 | } |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | public function assemble() |
58 | 58 | { |
59 | 59 | $this->callback( |
60 | - function () { |
|
60 | + function() { |
|
61 | 61 | $scriptPath = $this->createScript(); |
62 | 62 | if ($webUrl = $this->get('webUrl')) { |
63 | 63 | $this->callScript($webUrl, $scriptPath); |
64 | 64 | } else { |
65 | - $this->scp($scriptPath, '{node}:{node.webRoot}/' . $scriptPath); |
|
65 | + $this->scp($scriptPath, '{node}:{node.webRoot}/'.$scriptPath); |
|
66 | 66 | foreach ($this->get('nodes') as $node) { |
67 | 67 | /* @var \Netresearch\Kite\Node $node */ |
68 | 68 | if ($webUrl = $node->get('webUrl', null)) { |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | */ |
84 | 84 | protected function createScript() |
85 | 85 | { |
86 | - $scriptPath = $this->get('baseDir') . '/ccc-' . uniqid() . '.php'; |
|
86 | + $scriptPath = $this->get('baseDir').'/ccc-'.uniqid().'.php'; |
|
87 | 87 | file_put_contents( |
88 | 88 | $scriptPath, |
89 | - '<?' . "php |
|
89 | + '<?'."php |
|
90 | 90 | if (function_exists('clearstatcache')) { |
91 | 91 | echo 'statcache|'; |
92 | 92 | clearstatcache(true); |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | */ |
117 | 117 | protected function callScript($baseUrl, $scriptPath) |
118 | 118 | { |
119 | - $url = rtrim($baseUrl, '/') . '/' . ltrim($scriptPath, '/'); |
|
119 | + $url = rtrim($baseUrl, '/').'/'.ltrim($scriptPath, '/'); |
|
120 | 120 | |
121 | - $this->console->output('Calling ' . $url, OutputInterface::VERBOSITY_DEBUG); |
|
121 | + $this->console->output('Calling '.$url, OutputInterface::VERBOSITY_DEBUG); |
|
122 | 122 | $ch = curl_init(); |
123 | 123 | curl_setopt($ch, CURLOPT_URL, $url); |
124 | 124 | curl_setopt($ch, CURLOPT_HEADER, 1); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $this->console->outdent(); |
135 | 135 | } else { |
136 | 136 | if ($caches) { |
137 | - $this->console->output('Cleared code caches (' . implode(', ', $caches) . ')'); |
|
137 | + $this->console->output('Cleared code caches ('.implode(', ', $caches).')'); |
|
138 | 138 | } else { |
139 | 139 | $this->console->output('No code caches found'); |
140 | 140 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | public function loadPreset($name) |
64 | 64 | { |
65 | - include dirname(dirname(__DIR__)) . '/presets/' . $name . '.php'; |
|
65 | + include dirname(dirname(__DIR__)).'/presets/'.$name.'.php'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -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 | /** |