Skip to content

Commit

Permalink
Removed the unclear debug param
Browse files Browse the repository at this point in the history
  • Loading branch information
janvernieuwe committed Apr 19, 2019
1 parent 836667e commit ac14a1d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
7 changes: 0 additions & 7 deletions doc/tasks/paratest.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ The PHPUnit configuration file to use.

Runner, WrapperRunner or SqliteRunner. (Default: Runner)

**debugger**

*Default: null*

Debugger settings for code coverage.
It can have a bin and a args key. These can be used to set the debug binary and additional arguments.

**coverage-xml**

*Default: null*
Expand Down
15 changes: 1 addition & 14 deletions src/Task/Paratest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace GrumPHP\Task;

use GrumPHP\Collection\ProcessArgumentsCollection;
use GrumPHP\Runner\TaskResult;
use GrumPHP\Runner\TaskResultInterface;
use GrumPHP\Task\Context\ContextInterface;
Expand All @@ -31,7 +30,6 @@ public function getConfigurableOptions(): OptionsResolver
'always_execute' => false,
'group' => [],
'runner' => null,
'debugger' => null,
'coverage-xml' => null,
'coverage-html' => null,
'log-junit' => null,
Expand All @@ -46,7 +44,6 @@ public function getConfigurableOptions(): OptionsResolver
$resolver->addAllowedTypes('configuration', ['null', 'string']);
$resolver->addAllowedTypes('always_execute', ['bool']);
$resolver->addAllowedTypes('runner', ['null', 'string']);
$resolver->addAllowedTypes('debugger', ['null', 'array']);
$resolver->addAllowedTypes('coverage-xml', ['null', 'string']);
$resolver->addAllowedTypes('coverage-html', ['null', 'string']);
$resolver->addAllowedTypes('log-junit', ['null', 'string']);
Expand All @@ -65,7 +62,7 @@ public function run(ContextInterface $context): TaskResultInterface
$config = $this->getConfiguration();

$files = $context->getFiles()->name('*.php');
if (!$config['always_execute'] && 0 === \count($files)) {
if (!$config['always_execute'] && 0 === count($files)) {
return TaskResult::createSkipped($this, $context);
}

Expand All @@ -81,16 +78,6 @@ public function run(ContextInterface $context): TaskResultInterface
$arguments->addOptionalArgument('--testsuite %s', $config['testsuite']);
$arguments->addOptionalCommaSeparatedArgument('--group=%s', $config['group']);

$coverageEnabled = !empty($config['coverage-xml'])
|| !empty($config['coverage-html'])
|| !empty($config['log-junit']);

if ($coverageEnabled && !empty($config['debugger'])) {
$bin = $config['debugger']['bin'];
$args = $config['debugger']['args'];
$arguments = new ProcessArgumentsCollection(array_merge([$bin], $args, $arguments->toArray()));
}

$process = $this->processBuilder->buildProcess($arguments);
$process->run();

Expand Down

0 comments on commit ac14a1d

Please sign in to comment.