From 231a6ab58308900afc8d2bad6cd30c8f5f462881 Mon Sep 17 00:00:00 2001 From: Joe Rieger Date: Mon, 10 Jun 2019 14:43:06 -0400 Subject: [PATCH 1/8] Add overall report --- src/Report/Text.php | 54 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/src/Report/Text.php b/src/Report/Text.php index 82a98cf84..ec86667ba 100644 --- a/src/Report/Text.php +++ b/src/Report/Text.php @@ -84,12 +84,14 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $report = $coverage->getReport(); $colors = [ - 'header' => '', - 'classes' => '', - 'methods' => '', - 'lines' => '', - 'reset' => '', - 'eol' => '', + 'header' => '', + 'classes' => '', + 'methods' => '', + 'lines' => '', + 'branches' => '', + 'paths' => '', + 'reset' => '', + 'eol' => '', ]; if ($showColors) { @@ -108,13 +110,23 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $report->getNumExecutableLines() ); + $colors['branches'] = $this->getCoverageColor( + $report->getNumTestedBranches(), + $report->getNumBranches() + ); + + $colors['paths'] = $this->getCoverageColor( + $report->getNumTestedPaths(), + $report->getNumPaths() + ); + $colors['reset'] = self::COLOR_RESET; $colors['header'] = self::COLOR_HEADER; $colors['eol'] = self::COLOR_EOL; } $classes = \sprintf( - ' Classes: %6s (%d/%d)', + ' Classes: %6s (%d/%d)', Util::percent( $report->getNumTestedClassesAndTraits(), $report->getNumClassesAndTraits(), @@ -125,7 +137,7 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin ); $methods = \sprintf( - ' Methods: %6s (%d/%d)', + ' Methods: %6s (%d/%d)', Util::percent( $report->getNumTestedMethods(), $report->getNumMethods(), @@ -136,7 +148,7 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin ); $lines = \sprintf( - ' Lines: %6s (%d/%d)', + ' Lines: %6s (%d/%d)', Util::percent( $report->getNumExecutedLines(), $report->getNumExecutableLines(), @@ -146,6 +158,28 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $report->getNumExecutableLines() ); + $branches = \sprintf( + ' Branches: %6s (%d/%d)', + Util::percent( + $report->getNumTestedBranches(), + $report->getNumBranches(), + true + ), + $report->getNumTestedBranches(), + $report->getNumBranches() + ); + + $paths = \sprintf( + ' Paths: %6s (%d/%d)', + Util::percent( + $report->getNumTestedPaths(), + $report->getNumPaths(), + true + ), + $report->getNumTestedPaths(), + $report->getNumPaths() + ); + $padding = \max(\array_map('strlen', [$classes, $methods, $lines])); if ($this->showOnlySummary) { @@ -166,6 +200,8 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $output .= $this->format($colors['classes'], $padding, $classes); $output .= $this->format($colors['methods'], $padding, $methods); $output .= $this->format($colors['lines'], $padding, $lines); + $output .= $this->format($colors['branches'], $padding, $branches); + $output .= $this->format($colors['paths'], $padding, $paths); if ($this->showOnlySummary) { return $output . \PHP_EOL; From 7829be2643507519c55ae16e344b705b2f4500b4 Mon Sep 17 00:00:00 2001 From: Joe Rieger Date: Mon, 10 Jun 2019 15:17:30 -0400 Subject: [PATCH 2/8] Finish per-class report --- src/Report/Text.php | 66 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/src/Report/Text.php b/src/Report/Text.php index ec86667ba..53c86e2f3 100644 --- a/src/Report/Text.php +++ b/src/Report/Text.php @@ -209,6 +209,11 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $classCoverage = []; + $maxMethods = 0; + $maxLines = 0; + $maxBranches = 0; + $maxPaths = 0; + foreach ($report as $item) { if (!$item instanceof File) { continue; @@ -221,21 +226,50 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $coveredClassStatements = 0; $coveredMethods = 0; $classMethods = 0; + $classPaths = 0; + $coveredClassPaths = 0; + $classBranches = 0; + $coveredClassBranches = 0; foreach ($class['methods'] as $method) { - if ($method['executableLines'] == 0) { + if ($method['executableLines'] === 0) { continue; } $classMethods++; $classStatements += $method['executableLines']; $coveredClassStatements += $method['executedLines']; + $classPaths += $method['executablePaths']; + $coveredClassPaths += $method['executedPaths']; + $classBranches += $method['executableBranches']; + $coveredClassBranches += $method['executedBranches']; - if ($method['coverage'] == 100) { + if ($method['coverage'] === 100) { $coveredMethods++; } } + $maxMethods = \max( + $maxMethods, + \strlen((string) $classMethods), + \strlen((string) $coveredMethods) + ); + $maxLines = \max( + $maxLines, + \strlen((string) $classStatements), + \strlen((string) $coveredClassStatements) + ); + $maxBranches = \max( + $maxBranches, + \strlen((string) $classBranches), + \strlen((string) $coveredClassBranches) + ); + $maxPaths = \max( + $maxPaths, + \strlen((string) $classPaths), + \strlen((string) $coveredClassPaths) + ); + $namespace = ''; if (!empty($class['package']['namespace'])) { @@ -251,27 +285,37 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin 'methodCount' => $classMethods, 'statementsCovered' => $coveredClassStatements, 'statementCount' => $classStatements, + 'pathsCovered' => $coveredClassPaths, + 'pathCount' => $classPaths, + 'branchesCovered' => $coveredClassBranches, + 'branchCount' => $classBranches, ]; } } \ksort($classCoverage); - $methodColor = ''; - $linesColor = ''; - $resetColor = ''; + $methodColor = ''; + $linesColor = ''; + $resetColor = ''; + $pathsColor = ''; + $branchesColor = ''; foreach ($classCoverage as $fullQualifiedPath => $classInfo) { - if ($this->showUncoveredFiles || $classInfo['statementsCovered'] != 0) { + if ($this->showUncoveredFiles || $classInfo['statementsCovered'] !== 0) { if ($showColors) { - $methodColor = $this->getCoverageColor($classInfo['methodsCovered'], $classInfo['methodCount']); - $linesColor = $this->getCoverageColor($classInfo['statementsCovered'], $classInfo['statementCount']); - $resetColor = $colors['reset']; + $methodColor = $this->getCoverageColor($classInfo['methodsCovered'], $classInfo['methodCount']); + $linesColor = $this->getCoverageColor($classInfo['statementsCovered'], $classInfo['statementCount']); + $branchesColor = $this->getCoverageColor($classInfo['branchesCovered'], $classInfo['branchCount']); + $pathsColor = $this->getCoverageColor($classInfo['pathsCovered'], $classInfo['pathCount']); + $resetColor = $colors['reset']; } $output .= \PHP_EOL . $fullQualifiedPath . \PHP_EOL - . ' ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], 2) . $resetColor . ' ' - . ' ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], 3) . $resetColor; + . ' ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], $maxMethods) . $resetColor . ' ' + . ' ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], $maxLines) . $resetColor . ' ' + . ' ' . $branchesColor . 'Branches: ' . $this->printCoverageCounts($classInfo['branchesCovered'], $classInfo['branchCount'], $maxBranches) . $resetColor . ' ' + . ' ' . $pathsColor . 'Paths: ' . $this->printCoverageCounts($classInfo['pathsCovered'], $classInfo['pathCount'], $maxPaths) . $resetColor; } } From e8988af89b9a13a7b14216f10dd447c70f2104fa Mon Sep 17 00:00:00 2001 From: Joe Rieger Date: Mon, 10 Jun 2019 15:18:11 -0400 Subject: [PATCH 3/8] Make the percent Util class return the same fixed-width empty string if the percent will be 0 --- src/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util.php b/src/Util.php index 71ec8e0bd..8e81c8c61 100644 --- a/src/Util.php +++ b/src/Util.php @@ -20,7 +20,7 @@ final class Util public static function percent(float $a, float $b, bool $asString = false, bool $fixedWidth = false) { if ($asString && $b == 0) { - return ''; + return $fixedWidth ? ' ' : ''; } $percent = 100; From 63f07a6a1426ea96af76c306f3b7b93813ca57db Mon Sep 17 00:00:00 2001 From: Joe Rieger Date: Tue, 11 Jun 2019 08:49:45 -0400 Subject: [PATCH 4/8] Add branch & path coverage flag to Text reporter --- src/Report/Text.php | 133 +++++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 52 deletions(-) diff --git a/src/Report/Text.php b/src/Report/Text.php index 53c86e2f3..3dd639faf 100644 --- a/src/Report/Text.php +++ b/src/Report/Text.php @@ -70,12 +70,18 @@ final class Text */ private $showOnlySummary; - public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, bool $showUncoveredFiles = false, bool $showOnlySummary = false) + /** + * @var bool + */ + private $determineBranchCoverage; + + public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, bool $showUncoveredFiles = false, bool $showOnlySummary = false, bool $determineBranchCoverage = false) { - $this->lowUpperBound = $lowUpperBound; - $this->highLowerBound = $highLowerBound; - $this->showUncoveredFiles = $showUncoveredFiles; - $this->showOnlySummary = $showOnlySummary; + $this->lowUpperBound = $lowUpperBound; + $this->highLowerBound = $highLowerBound; + $this->showUncoveredFiles = $showUncoveredFiles; + $this->showOnlySummary = $showOnlySummary; + $this->determineBranchCoverage = $determineBranchCoverage; } public function process(CodeCoverage $coverage, bool $showColors = false): string @@ -110,15 +116,17 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $report->getNumExecutableLines() ); - $colors['branches'] = $this->getCoverageColor( - $report->getNumTestedBranches(), - $report->getNumBranches() - ); + if ($this->determineBranchCoverage) { + $colors['branches'] = $this->getCoverageColor( + $report->getNumTestedBranches(), + $report->getNumBranches() + ); - $colors['paths'] = $this->getCoverageColor( - $report->getNumTestedPaths(), - $report->getNumPaths() - ); + $colors['paths'] = $this->getCoverageColor( + $report->getNumTestedPaths(), + $report->getNumPaths() + ); + } $colors['reset'] = self::COLOR_RESET; $colors['header'] = self::COLOR_HEADER; @@ -158,27 +166,32 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $report->getNumExecutableLines() ); - $branches = \sprintf( - ' Branches: %6s (%d/%d)', - Util::percent( + $paths = ''; + $branches = ''; + + if ($this->determineBranchCoverage) { + $branches = \sprintf( + ' Branches: %6s (%d/%d)', + Util::percent( + $report->getNumTestedBranches(), + $report->getNumBranches(), + true + ), $report->getNumTestedBranches(), - $report->getNumBranches(), - true - ), - $report->getNumTestedBranches(), - $report->getNumBranches() - ); + $report->getNumBranches() + ); - $paths = \sprintf( - ' Paths: %6s (%d/%d)', - Util::percent( + $paths = \sprintf( + ' Paths: %6s (%d/%d)', + Util::percent( + $report->getNumTestedPaths(), + $report->getNumPaths(), + true + ), $report->getNumTestedPaths(), - $report->getNumPaths(), - true - ), - $report->getNumTestedPaths(), - $report->getNumPaths() - ); + $report->getNumPaths() + ); + } $padding = \max(\array_map('strlen', [$classes, $methods, $lines])); @@ -200,8 +213,11 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $output .= $this->format($colors['classes'], $padding, $classes); $output .= $this->format($colors['methods'], $padding, $methods); $output .= $this->format($colors['lines'], $padding, $lines); - $output .= $this->format($colors['branches'], $padding, $branches); - $output .= $this->format($colors['paths'], $padding, $paths); + + if ($this->determineBranchCoverage) { + $output .= $this->format($colors['branches'], $padding, $branches); + $output .= $this->format($colors['paths'], $padding, $paths); + } if ($this->showOnlySummary) { return $output . \PHP_EOL; @@ -239,10 +255,13 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin $classMethods++; $classStatements += $method['executableLines']; $coveredClassStatements += $method['executedLines']; - $classPaths += $method['executablePaths']; - $coveredClassPaths += $method['executedPaths']; - $classBranches += $method['executableBranches']; - $coveredClassBranches += $method['executedBranches']; + + if ($this->determineBranchCoverage) { + $classPaths += $method['executablePaths']; + $coveredClassPaths += $method['executedPaths']; + $classBranches += $method['executableBranches']; + $coveredClassBranches += $method['executedBranches']; + } if ($method['coverage'] === 100) { $coveredMethods++; @@ -259,16 +278,19 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin \strlen((string) $classStatements), \strlen((string) $coveredClassStatements) ); - $maxBranches = \max( - $maxBranches, - \strlen((string) $classBranches), - \strlen((string) $coveredClassBranches) - ); - $maxPaths = \max( - $maxPaths, - \strlen((string) $classPaths), - \strlen((string) $coveredClassPaths) - ); + + if ($this->determineBranchCoverage) { + $maxBranches = \max( + $maxBranches, + \strlen((string) $classBranches), + \strlen((string) $coveredClassBranches) + ); + $maxPaths = \max( + $maxPaths, + \strlen((string) $classPaths), + \strlen((string) $coveredClassPaths) + ); + } $namespace = ''; @@ -306,16 +328,23 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin if ($showColors) { $methodColor = $this->getCoverageColor($classInfo['methodsCovered'], $classInfo['methodCount']); $linesColor = $this->getCoverageColor($classInfo['statementsCovered'], $classInfo['statementCount']); - $branchesColor = $this->getCoverageColor($classInfo['branchesCovered'], $classInfo['branchCount']); - $pathsColor = $this->getCoverageColor($classInfo['pathsCovered'], $classInfo['pathCount']); + + if ($this->determineBranchCoverage) { + $branchesColor = $this->getCoverageColor($classInfo['branchesCovered'], $classInfo['branchCount']); + $pathsColor = $this->getCoverageColor($classInfo['pathsCovered'], $classInfo['pathCount']); + } $resetColor = $colors['reset']; } $output .= \PHP_EOL . $fullQualifiedPath . \PHP_EOL . ' ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], $maxMethods) . $resetColor . ' ' - . ' ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], $maxLines) . $resetColor . ' ' - . ' ' . $branchesColor . 'Branches: ' . $this->printCoverageCounts($classInfo['branchesCovered'], $classInfo['branchCount'], $maxBranches) . $resetColor . ' ' - . ' ' . $pathsColor . 'Paths: ' . $this->printCoverageCounts($classInfo['pathsCovered'], $classInfo['pathCount'], $maxPaths) . $resetColor; + . ' ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], $maxLines) . $resetColor; + + if ($this->determineBranchCoverage) { + $output .= '' + . ' ' . $branchesColor . 'Branches: ' . $this->printCoverageCounts($classInfo['branchesCovered'], $classInfo['branchCount'], $maxBranches) . $resetColor . ' ' + . ' ' . $pathsColor . 'Paths: ' . $this->printCoverageCounts($classInfo['pathsCovered'], $classInfo['pathCount'], $maxPaths) . $resetColor; + } } } From 6f53e9bc9776f5df71dd7b953b64c1510c6c317e Mon Sep 17 00:00:00 2001 From: Joe Rieger Date: Tue, 11 Jun 2019 08:59:27 -0400 Subject: [PATCH 5/8] Add flag to TextReport constructor --- phpunit.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index 37e22199f..fe570a8a2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,6 +8,10 @@ tests/tests + + + + src From c3aab3c9dee4272f24c248d7e0d12f9826d764ba Mon Sep 17 00:00:00 2001 From: Joe Rieger Date: Tue, 11 Jun 2019 15:29:17 -0400 Subject: [PATCH 6/8] Fix some of the coverage issues --- src/CodeCoverage.php | 9 ++++++--- src/Driver/Xdebug.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/CodeCoverage.php b/src/CodeCoverage.php index f87a15aba..fc355e18f 100644 --- a/src/CodeCoverage.php +++ b/src/CodeCoverage.php @@ -619,7 +619,10 @@ private function initializeFilesThatAreSeenTheFirstTime(array $data): void foreach ($fileData['lines'] as $lineNumber => $flag) { if ($flag === Driver::LINE_NOT_EXECUTABLE) { $this->data[$file]['lines'][$lineNumber] = null; + } else { + $this->addCoverageLinePathCovered($file, $lineNumber, false); } + } foreach ($fileData['functions'] as $functionName => $functionData) { @@ -1190,9 +1193,9 @@ private function initializeData(): void continue; } - foreach (\array_keys($fileCoverage) as $key) { - if ($fileCoverage[$key] === Driver::LINE_EXECUTED) { - $fileCoverage[$key] = Driver::LINE_NOT_EXECUTED; + foreach (\array_keys($fileCoverage['lines']) as $key) { + if ($fileCoverage['lines'][$key] === Driver::LINE_EXECUTED) { + $fileCoverage['lines'][$key] = Driver::LINE_NOT_EXECUTED; } } diff --git a/src/Driver/Xdebug.php b/src/Driver/Xdebug.php index 7a97cc8a2..2e61e2dbb 100644 --- a/src/Driver/Xdebug.php +++ b/src/Driver/Xdebug.php @@ -54,7 +54,7 @@ public function start(bool $determineUnusedAndDead = true): void } if ($this->determineBranchCoverage) { - $flag = XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK; + $flag |= XDEBUG_CC_BRANCH_CHECK; } \xdebug_start_code_coverage($flag); From 592e85231662f1ec2d528c85d72293cf9e0305b4 Mon Sep 17 00:00:00 2001 From: Joe Rieger Date: Wed, 12 Jun 2019 08:29:00 -0400 Subject: [PATCH 7/8] Add flag to TextReport constructor Fix additional covered lines functionality --- phpunit.xml | 4 ---- src/CodeCoverage.php | 2 -- src/Node/File.php | 45 ++++++++++++++++++++++++-------------------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index fe570a8a2..37e22199f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,10 +8,6 @@ tests/tests - - - - src diff --git a/src/CodeCoverage.php b/src/CodeCoverage.php index fc355e18f..a6dd15e92 100644 --- a/src/CodeCoverage.php +++ b/src/CodeCoverage.php @@ -626,7 +626,6 @@ private function initializeFilesThatAreSeenTheFirstTime(array $data): void } foreach ($fileData['functions'] as $functionName => $functionData) { - // @todo - should this have a helper to merge covered paths? $this->data[$file]['paths'][$functionName] = $functionData['paths']; foreach ($functionData['branches'] as $branchIndex => $branchData) { @@ -840,7 +839,6 @@ private function addUncoveredFilesFromWhitelist(): void for ($line = 1; $line <= $lines; $line++) { $data[$uncoveredFile]['lines'][$line] = Driver::LINE_NOT_EXECUTED; } - // @todo - do the same here with functions and paths } $this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST'); diff --git a/src/Node/File.php b/src/Node/File.php index 74087de78..7ff0fa9f2 100644 --- a/src/Node/File.php +++ b/src/Node/File.php @@ -377,16 +377,21 @@ private function calculateStatistics(): void unset($tokens); foreach (\range(1, $this->linesOfCode['loc']) as $lineNumber) { - if (isset($this->coverageData['lines'][$lineNumber])) { - foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { - $codeUnit['executableLines']++; - } + // Check to see if we've identified this line as executed, not executed, or not executable + if (\array_key_exists($lineNumber, $this->coverageData['lines'])) { + // If the element is null, that indicates this line is not executable + if ($this->coverageData['lines'][$lineNumber] !== null) { + foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { + $codeUnit['executableLines']++; + } + + unset($codeUnit); - unset($codeUnit); + $this->numExecutableLines++; + } - $this->numExecutableLines++; - if (\count($this->coverageData['lines'][$lineNumber]) > 0) { + if ($this->coverageData['lines'][$lineNumber]['pathCovered'] === true) { foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) { $codeUnit['executedLines']++; } @@ -472,6 +477,19 @@ private function calcAndApplyClassAggregate( foreach ($classOrTrait['methods'] as &$method) { $methodName = $method['methodName']; + if ($method['executableLines'] > 0) { + $method['coverage'] = ($method['executedLines'] / $method['executableLines']) * 100; + } else { + $method['coverage'] = 100; + } + + $method['crap'] = $this->crap( + $method['ccn'], + $method['coverage'] + ); + + $classOrTrait['ccn'] += $method['ccn']; + if (isset($this->coverageData['paths'])) { $methodCoveragePath = $methodName; @@ -499,19 +517,6 @@ private function calcAndApplyClassAggregate( $this->numTestedPaths += $numExexutedPaths; } - if ($method['executableLines'] > 0) { - $method['coverage'] = ($method['executedLines'] / - $method['executableLines']) * 100; - } else { - $method['coverage'] = 100; - } - - $method['crap'] = $this->crap( - $method['ccn'], - $method['coverage'] - ); - - $classOrTrait['ccn'] += $method['ccn']; } if (isset($this->coverageData['branches'])) { From 4cd54ee72ca1268b66232d7b9c87c3647b681947 Mon Sep 17 00:00:00 2001 From: Joe Rieger Date: Wed, 12 Jun 2019 08:52:41 -0400 Subject: [PATCH 8/8] Fix XDebug filters --- src/Driver/Xdebug.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Driver/Xdebug.php b/src/Driver/Xdebug.php index 2e61e2dbb..7a97cc8a2 100644 --- a/src/Driver/Xdebug.php +++ b/src/Driver/Xdebug.php @@ -54,7 +54,7 @@ public function start(bool $determineUnusedAndDead = true): void } if ($this->determineBranchCoverage) { - $flag |= XDEBUG_CC_BRANCH_CHECK; + $flag = XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK; } \xdebug_start_code_coverage($flag);