Permalink
Browse files

Refactor.

  • Loading branch information...
1 parent 8806681 commit 950dcf7580612bc603a1fdd2d81a283eb222d47c @sebastianbergmann committed Oct 7, 2011
Showing with 28 additions and 13 deletions.
  1. +28 −13 PHPUnit/TextUI/Command.php
View
@@ -282,23 +282,38 @@ protected function handleArguments(array $argv)
case '--coverage-clover':
case '--coverage-html':
case '--coverage-text': {
- if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
- if($option[0] == '--coverage-clover') {
- $this->arguments['coverageClover'] = $option[1];
- } else if($option[0] == 'coverage--html') {
- $this->arguments['reportDirectory'] = $option[1];
- } else {
- $this->arguments['coverageText'] = $option[1];
- $this->arguments['coverageTextShowUncoveredFiles'] = false;
- }
- } else if (!extension_loaded('tokenizer')) {
+ if (!extension_loaded('tokenizer')) {
$this->showExtensionNotLoadedMessage(
- 'tokenizer', 'No code coverage will be generated.'
+ 'tokenizer', 'No code coverage will be generated.'
);
- } else {
+
+ continue;
+ }
+
+ if (!extension_loaded('xdebug')) {
$this->showExtensionNotLoadedMessage(
- 'Xdebug', 'No code coverage will be generated.'
+ 'Xdebug', 'No code coverage will be generated.'
);
+
+ continue;
+ }
+
+ switch ($option[0]) {
+ case '--coverage-clover': {
+ $this->arguments['coverageClover'] = $option[1];
+ }
+ break;
+
+ case '--coverage-html': {
+ $this->arguments['reportDirectory'] = $option[1];
+ }
+ break;
+
+ case '--coverage-text': {
+ $this->arguments['coverageText'] = $option[1];
+ $this->arguments['coverageTextShowUncoveredFiles'] = FALSE;
+ }
+ break;
}
}
break;

0 comments on commit 950dcf7

Please sign in to comment.