@@ -198,7 +198,7 @@ |
||
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
| 201 | - * @param array $dirs |
|
| 201 | + * @param string[] $dirs |
|
| 202 | 202 | * |
| 203 | 203 | * @return array|\Robo\Result |
| 204 | 204 | * |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function dirPermissions($permission) |
| 129 | 129 | { |
| 130 | - $this->chmod = (int) $permission; |
|
| 130 | + $this->chmod = (int)$permission; |
|
| 131 | 131 | |
| 132 | 132 | return $this; |
| 133 | 133 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | { |
| 177 | 177 | if (!$this->fs->isAbsolutePath($dir)) { |
| 178 | 178 | // attach the relative path to current working directory |
| 179 | - $dir = getcwd().'/'.$dir; |
|
| 179 | + $dir = getcwd() . '/' . $dir; |
|
| 180 | 180 | } |
| 181 | 181 | $this->parentDir = $dir; |
| 182 | 182 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | } catch (\InvalidArgumentException $e) { |
| 231 | 231 | // if finder cannot handle it, try with in()->name() |
| 232 | 232 | if (strpos($dir, '/') === false) { |
| 233 | - $dir = './'.$dir; |
|
| 233 | + $dir = './' . $dir; |
|
| 234 | 234 | } |
| 235 | 235 | $parts = explode('/', $dir); |
| 236 | 236 | $new_dir = implode('/', array_slice($parts, 0, -1)); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | protected function getTarget($file, $to) |
| 262 | 262 | { |
| 263 | - $target = $to.'/'.basename($file); |
|
| 263 | + $target = $to . '/' . basename($file); |
|
| 264 | 264 | if ($this->parents !== array(0, 0)) { |
| 265 | 265 | // if the parent is set, create additional directories inside target |
| 266 | 266 | // get relative path to parentDir |
@@ -268,10 +268,10 @@ discard block |
||
| 268 | 268 | // get top parents and bottom parents |
| 269 | 269 | $parts = explode('/', rtrim($rel_path, '/')); |
| 270 | 270 | $prefix_dir = ''; |
| 271 | - $prefix_dir .= ($this->parents[0] > 0 ? implode('/', array_slice($parts, 0, $this->parents[0])).'/' : ''); |
|
| 271 | + $prefix_dir .= ($this->parents[0] > 0 ? implode('/', array_slice($parts, 0, $this->parents[0])) . '/' : ''); |
|
| 272 | 272 | $prefix_dir .= ($this->parents[1] > 0 ? implode('/', array_slice($parts, (0 - $this->parents[1]), $this->parents[1])) : ''); |
| 273 | 273 | $prefix_dir = rtrim($prefix_dir, '/'); |
| 274 | - $target = $to.'/'.$prefix_dir.'/'.basename($file); |
|
| 274 | + $target = $to . '/' . $prefix_dir . '/' . basename($file); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | return $target; |
@@ -90,25 +90,25 @@ |
||
| 90 | 90 | $this->checkResources($targets); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - /** |
|
| 94 | - * Wrapper method around phps is_dir() |
|
| 95 | - * |
|
| 96 | - * @param string $directory |
|
| 97 | - * |
|
| 98 | - * @return bool |
|
| 99 | - */ |
|
| 93 | + /** |
|
| 94 | + * Wrapper method around phps is_dir() |
|
| 95 | + * |
|
| 96 | + * @param string $directory |
|
| 97 | + * |
|
| 98 | + * @return bool |
|
| 99 | + */ |
|
| 100 | 100 | protected function isDir($directory) |
| 101 | 101 | { |
| 102 | 102 | return is_dir($directory); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Wrapper method around phps file_exists() |
|
| 107 | - * |
|
| 108 | - * @param string $file |
|
| 109 | - * |
|
| 110 | - * @return bool |
|
| 111 | - */ |
|
| 105 | + /** |
|
| 106 | + * Wrapper method around phps file_exists() |
|
| 107 | + * |
|
| 108 | + * @param string $file |
|
| 109 | + * |
|
| 110 | + * @return bool |
|
| 111 | + */ |
|
| 112 | 112 | protected function isFile($file) |
| 113 | 113 | { |
| 114 | 114 | return file_exists($file); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * @param string $type |
| 49 | 49 | * Allowed values: "file", "dir", "fileAndDir". |
| 50 | 50 | * |
| 51 | - * @return bool |
|
| 51 | + * @return boolean|null |
|
| 52 | 52 | */ |
| 53 | 53 | protected function checkResource($resource, $type) |
| 54 | 54 | { |
@@ -353,7 +353,7 @@ |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | /** |
| 356 | - * @param array|string $pattern |
|
| 356 | + * @param string[] $pattern |
|
| 357 | 357 | * |
| 358 | 358 | * @return $this |
| 359 | 359 | */ |
@@ -1,7 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use AspectMock\Test as test; |
|
| 4 | - |
|
| 5 | 3 | class HgTest extends \Codeception\TestCase\Test |
| 6 | 4 | { |
| 7 | 5 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param string $cmd |
| 153 | 153 | * |
| 154 | - * @return bool|string |
|
| 154 | + * @return string|false |
|
| 155 | 155 | */ |
| 156 | 156 | protected function findExecutable($cmd) |
| 157 | 157 | { |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
| 183 | - * @return bool|string |
|
| 183 | + * @return string|false |
|
| 184 | 184 | */ |
| 185 | 185 | protected function findProjectBin() |
| 186 | 186 | { |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | protected function findProjectBin() |
| 90 | 90 | { |
| 91 | 91 | $cwd = getcwd(); |
| 92 | - $candidates = [ __DIR__ . '/../../vendor/bin', __DIR__ . '/../../bin', $cwd . '/vendor/bin' ]; |
|
| 92 | + $candidates = [__DIR__ . '/../../vendor/bin', __DIR__ . '/../../bin', $cwd . '/vendor/bin']; |
|
| 93 | 93 | |
| 94 | 94 | // If this project is inside a vendor directory, give highest priority |
| 95 | 95 | // to that directory. |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | * |
| 80 | 80 | * @covers ::args |
| 81 | 81 | * |
| 82 | - * @param string $expected |
|
| 82 | + * @param string $expectedLinux |
|
| 83 | 83 | * @param array $args |
| 84 | 84 | */ |
| 85 | 85 | public function testArgs($expectedLinux, $expectedWindows, $args) |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | protected $command; |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | - * @param string|\Robo\Contract\CommandInterface $command |
|
| 46 | + * @param string $command |
|
| 47 | 47 | */ |
| 48 | 48 | public function __construct($command) |
| 49 | 49 | { |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Robo\Task\Base; |
| 3 | 3 | |
| 4 | -use Robo\Common\ExecTrait; |
|
| 5 | 4 | use Robo\Contract\CommandInterface; |
| 6 | 5 | use Robo\Contract\PrintedInterface; |
| 7 | 6 | use Robo\Contract\SimulatedInterface; |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Robo\Exception\TaskException; |
| 6 | 6 | use Robo\Task\BaseTask; |
| 7 | 7 | use Robo\Contract\CommandInterface; |
| 8 | -use Symfony\Component\Process\Process; |
|
| 9 | 8 | |
| 10 | 9 | /** |
| 11 | 10 | * Executes Codeception tests |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | // guess the best path for the executables based on __DIR__ |
| 183 | 183 | if (($pos = strpos(__DIR__, 'consolidation/robo')) !== false) { |
| 184 | 184 | // the executables should be stored in vendor/bin |
| 185 | - $this->executableTargetDir = substr(__DIR__, 0, $pos).'bin'; |
|
| 185 | + $this->executableTargetDir = substr(__DIR__, 0, $pos) . 'bin'; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | // check if the executables are already available |
| 189 | 189 | foreach ($this->imageminRepos as $exec => $url) { |
| 190 | - $path = $this->executableTargetDir.'/'.$exec; |
|
| 190 | + $path = $this->executableTargetDir . '/' . $exec; |
|
| 191 | 191 | // if this is Windows add a .exe extension |
| 192 | 192 | if (substr($this->getOS(), 0, 3) == 'win') { |
| 193 | 193 | $path .= '.exe'; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | } catch (\InvalidArgumentException $e) { |
| 290 | 290 | // if finder cannot handle it, try with in()->name() |
| 291 | 291 | if (strpos($dir, '/') === false) { |
| 292 | - $dir = './'.$dir; |
|
| 292 | + $dir = './' . $dir; |
|
| 293 | 293 | } |
| 294 | 294 | $parts = explode('/', $dir); |
| 295 | 295 | $new_dir = implode('/', array_slice($parts, 0, -1)); |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | */ |
| 320 | 320 | protected function getTarget($file, $to) |
| 321 | 321 | { |
| 322 | - $target = $to.'/'.basename($file); |
|
| 322 | + $target = $to . '/' . basename($file); |
|
| 323 | 323 | |
| 324 | 324 | return $target; |
| 325 | 325 | } |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | protected function getOS() |
| 433 | 433 | { |
| 434 | 434 | $os = php_uname('s'); |
| 435 | - $os .= '/'.php_uname('m'); |
|
| 435 | + $os .= '/' . php_uname('m'); |
|
| 436 | 436 | // replace x86_64 to x64, because the imagemin repo uses that |
| 437 | 437 | $os = str_replace('x86_64', 'x64', $os); |
| 438 | 438 | // replace i386, i686, etc to x86, because of imagemin |
@@ -492,10 +492,10 @@ discard block |
||
| 492 | 492 | $this->printTaskInfo('Downloading the {executable} executable from the imagemin repository', ['executable' => $executable]); |
| 493 | 493 | |
| 494 | 494 | $os = $this->getOS(); |
| 495 | - $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'?raw=true'; |
|
| 495 | + $url = $this->imageminRepos[$executable] . '/blob/master/vendor/' . $os . '/' . $executable . '?raw=true'; |
|
| 496 | 496 | if (substr($os, 0, 3) == 'win') { |
| 497 | 497 | // if it is win, add a .exe extension |
| 498 | - $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'.exe?raw=true'; |
|
| 498 | + $url = $this->imageminRepos[$executable] . '/blob/master/vendor/' . $os . '/' . $executable . '.exe?raw=true'; |
|
| 499 | 499 | } |
| 500 | 500 | $data = @file_get_contents($url, false, null); |
| 501 | 501 | if ($data === false) { |
@@ -525,10 +525,10 @@ discard block |
||
| 525 | 525 | mkdir($this->executableTargetDir); |
| 526 | 526 | } |
| 527 | 527 | // save the executable into the target dir |
| 528 | - $path = $this->executableTargetDir.'/'.$executable; |
|
| 528 | + $path = $this->executableTargetDir . '/' . $executable; |
|
| 529 | 529 | if (substr($os, 0, 3) == 'win') { |
| 530 | 530 | // if it is win, add a .exe extension |
| 531 | - $path = $this->executableTargetDir.'/'.$executable.'.exe'; |
|
| 531 | + $path = $this->executableTargetDir . '/' . $executable . '.exe'; |
|
| 532 | 532 | } |
| 533 | 533 | $result = file_put_contents($path, $data); |
| 534 | 534 | if ($result === false) { |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | chmod($path, 0755); |
| 541 | 541 | |
| 542 | 542 | // if everything successful, store the executable path |
| 543 | - $this->executablePaths[$executable] = $this->executableTargetDir.'/'.$executable; |
|
| 543 | + $this->executablePaths[$executable] = $this->executableTargetDir . '/' . $executable; |
|
| 544 | 544 | // if it is win, add a .exe extension |
| 545 | 545 | if (substr($os, 0, 3) == 'win') { |
| 546 | 546 | $this->executablePaths[$executable] .= '.exe'; |