@@ -274,6 +274,9 @@ |
||
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | + /** |
|
| 278 | + * @param integer $size |
|
| 279 | + */ |
|
| 277 | 280 | private function formatBytes($size, $precision = 2) |
| 278 | 281 | { |
| 279 | 282 | if (!$size) { |
@@ -351,14 +351,14 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | private function countNumTestsInChunk(array $chunk) : int |
| 353 | 353 | { |
| 354 | - return array_sum(array_map(function (array $chunkFile) { |
|
| 354 | + return array_sum(array_map(function(array $chunkFile) { |
|
| 355 | 355 | return $chunkFile['numTests']; |
| 356 | 356 | }, $chunk)); |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | private function buildFilesFromChunk(array $chunk) : array |
| 360 | 360 | { |
| 361 | - return array_map(function (array $chunkFile) { |
|
| 361 | + return array_map(function(array $chunkFile) { |
|
| 362 | 362 | return $chunkFile['file']; |
| 363 | 363 | }, $chunk); |
| 364 | 364 | } |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | |
| 378 | 378 | private function createProgressCallback(ProgressBar $progressBar) |
| 379 | 379 | { |
| 380 | - return function ($type, $buffer) use ($progressBar) { |
|
| 380 | + return function($type, $buffer) use ($progressBar) { |
|
| 381 | 381 | if ($progressBar) { |
| 382 | 382 | if (in_array($buffer, ['F', 'E'])) { |
| 383 | 383 | $progressBar->setBarCharacter('<fg=red>=</>'); |
@@ -105,7 +105,6 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * @param string $className |
| 108 | - * @param string $srcDir |
|
| 109 | 108 | * |
| 110 | 109 | * @return string |
| 111 | 110 | */ |
@@ -304,7 +303,6 @@ discard block |
||
| 304 | 303 | } |
| 305 | 304 | |
| 306 | 305 | /** |
| 307 | - * @param ReflectionClass $this->reflectionClass |
|
| 308 | 306 | * |
| 309 | 307 | * @return string |
| 310 | 308 | */ |
@@ -342,7 +342,7 @@ |
||
| 342 | 342 | |
| 343 | 343 | $dependencies = array_unique($dependencies); |
| 344 | 344 | |
| 345 | - $useStatementsCode = array_map(function ($dependency) { |
|
| 345 | + $useStatementsCode = array_map(function($dependency) { |
|
| 346 | 346 | return sprintf('use %s;', $dependency); |
| 347 | 347 | }, $dependencies); |
| 348 | 348 | |
@@ -2,10 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace PHPChunkit; |
| 4 | 4 | |
| 5 | -use PHPChunkit\Configuration; |
|
| 6 | -use PHPChunkit\PHPChunkitApplication; |
|
| 7 | -use Symfony\Component\Console\Application; |
|
| 8 | - |
|
| 9 | 5 | /** |
| 10 | 6 | * @testClass PHPChunkit\Test\PHPChunkitTest |
| 11 | 7 | */ |
@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace PHPChunkit; |
| 4 | 4 | |
| 5 | -use PHP_Token_Stream; |
|
| 6 | - |
|
| 7 | 5 | /** |
| 8 | 6 | * @testClass PHPChunkit\Test\TestCounterTest |
| 9 | 7 | */ |
@@ -188,6 +188,9 @@ |
||
| 188 | 188 | return $process->getExitCode(); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | + /** |
|
| 192 | + * @param string $command |
|
| 193 | + */ |
|
| 191 | 194 | public function getProcess($command, array $env = []) : Process |
| 192 | 195 | { |
| 193 | 196 | foreach ($env as $key => $value) { |
@@ -2,14 +2,12 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace PHPChunkit; |
| 4 | 4 | |
| 5 | -use PHPUnit_Framework_TestCase; |
|
| 6 | 5 | use RuntimeException; |
| 7 | 6 | use Symfony\Component\Console\Application; |
| 8 | 7 | use Symfony\Component\Console\Input\ArrayInput; |
| 9 | 8 | use Symfony\Component\Console\Input\InputInterface; |
| 10 | 9 | use Symfony\Component\Console\Output\Output; |
| 11 | 10 | use Symfony\Component\Console\Output\OutputInterface; |
| 12 | -use Symfony\Component\Finder\Finder; |
|
| 13 | 11 | use Symfony\Component\Process\Process; |
| 14 | 12 | |
| 15 | 13 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // temp config file |
| 79 | 79 | $config = tempnam('/tmp', 'phpunitxml'); |
| 80 | - register_shutdown_function(function () use ($config) { |
|
| 80 | + register_shutdown_function(function() use ($config) { |
|
| 81 | 81 | unlink($config); |
| 82 | 82 | }); |
| 83 | 83 | |
@@ -172,12 +172,12 @@ discard block |
||
| 172 | 172 | $process = $this->getProcess($command, $env); |
| 173 | 173 | |
| 174 | 174 | if ($callback === null) { |
| 175 | - $callback = function ($output) { |
|
| 175 | + $callback = function($output) { |
|
| 176 | 176 | echo $output; |
| 177 | 177 | }; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $process->run(function ($type, $output) use ($callback) { |
|
| 180 | + $process->run(function($type, $output) use ($callback) { |
|
| 181 | 181 | $callback($output); |
| 182 | 182 | }); |
| 183 | 183 | |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | sleep(.5); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - protected function while() : bool |
|
| 74 | + protected function while () : bool |
|
| 75 | 75 | { |
| 76 | 76 | return true; |
| 77 | 77 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | ]); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - register_shutdown_function(function () use ($output) { |
|
| 50 | + register_shutdown_function(function() use ($output) { |
|
| 51 | 51 | $output->writeln('<info>Cleaning up sandbox...</info>'); |
| 52 | 52 | |
| 53 | 53 | $this->eventDispatcher->dispatch(Events::SANDBOX_CLEANUP); |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | |
| 150 | 150 | private function isSandboxEnabled() : bool |
| 151 | 151 | { |
| 152 | - return array_filter($_SERVER['argv'], function ($arg) { |
|
| 152 | + return array_filter($_SERVER['argv'], function($arg) { |
|
| 153 | 153 | return strpos($arg, 'sandbox') !== false; |
| 154 | 154 | }) ? true : false; |
| 155 | 155 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | for ($i = 0, $len = count($matches['type']); $i < $len; $i++) { |
| 70 | 70 | if (!empty($matches['ns'][$i])) { |
| 71 | - $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]) . '\\'; |
|
| 71 | + $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]).'\\'; |
|
| 72 | 72 | } else { |
| 73 | 73 | $name = $matches['name'][$i]; |
| 74 | 74 | // skip anon classes extending/implementing |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | // the class name. |
| 86 | 86 | $name = rtrim($name, ':'); |
| 87 | 87 | } |
| 88 | - $classes[] = ltrim($namespace . $name, '\\'); |
|
| 88 | + $classes[] = ltrim($namespace.$name, '\\'); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |