Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [4.1.2] - 2018-03-21

- Fix `--no-coverage` option introducing errors when running non `run` commands.
- `--no-coverage` option is now available to all phpspec commands (not only
`run`). (#30)

## [4.1.1] - 2018-03-19

- Added `--no-coverage` option which can skip code coverage generation during
Expand Down Expand Up @@ -80,6 +86,7 @@ as [leanphp/phpspec-code-coverage][0].
- Support configuring a blacklist of files to be excluded from code coverage
reports (`blaclist_files` option).

[4.1.2]: https://github.com/leanphp/phpspec-code-coverage/releases/tag/v4.1.2
[4.1.1]: https://github.com/leanphp/phpspec-code-coverage/releases/tag/v4.1.1
[4.1.0]: https://github.com/leanphp/phpspec-code-coverage/releases/tag/v4.1.0
[4.0.0]: https://github.com/leanphp/phpspec-code-coverage/releases/tag/v4.0.0
Expand Down
7 changes: 2 additions & 5 deletions src/CodeCoverageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ class CodeCoverageExtension implements \PhpSpec\Extension
public function load(ServiceContainer $container, array $params = [])
{
foreach ($container->getByTag('console.commands') as $command) {
if ($command->getName() == 'run') {
$command->addOption('no-coverage', null, InputOption::VALUE_NONE, 'Skip code coverage generation');
}
$command->addOption('no-coverage', null, InputOption::VALUE_NONE, 'Skip code coverage generation');
}


$container->define('code_coverage.filter', function () {
return new Filter();
});
Expand Down Expand Up @@ -107,7 +104,7 @@ public function load(ServiceContainer $container, array $params = [])

$skipCoverage = false;
$input = $container->get('console.input');
if ($input->getOption('no-coverage')) {
if ($input->hasOption('no-coverage') && $input->getOption('no-coverage')) {
$skipCoverage = true;
}

Expand Down