Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional HTML report views for branch/path data #778

Merged
Prev Previous commit
Make psalm happier
dvdoug committed Jul 13, 2020
commit 1e01ba6ca59bbd9b7e35ab9f6e0e1a42556058ef
8 changes: 7 additions & 1 deletion .psalm/baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.11.6@7fc1f50f54bd6b174b1c43a37c1b0b151915d55c">
<files psalm-version="3.12.2@7c7ebd068f8acaba211d4a2c707c4ba90874fa26">
<file src="src/CodeCoverage.php">
<ArgumentTypeCoercion occurrences="1">
<code>$unit[0]</code>
@@ -145,6 +145,12 @@
<code>getEndLine</code>
</PossiblyUndefinedMethod>
</file>
<file src="src/Report/Html/Renderer/File.php">
<RedundantCondition occurrences="2">
<code>$lineData[$i]['includedInHitBranches'] === 0</code>
<code>$lineData[$i]['includedInHitPaths'] === 0</code>
</RedundantCondition>
</file>
<file src="src/Report/Xml/BuildInformation.php">
<PossiblyNullReference occurrences="1">
<code>createElementNS</code>
6 changes: 6 additions & 0 deletions src/Report/Html/Renderer/File.php
Original file line number Diff line number Diff line change
@@ -470,6 +470,7 @@ private function renderSourceWithBranchCoverage(FileNode $node): string

$lineData = [];

/** @var int $line */
foreach (array_keys($codeLines) as $line) {
$lineData[$line + 1] = [
'includedInBranches' => 0,
@@ -498,6 +499,7 @@ private function renderSourceWithBranchCoverage(FileNode $node): string
$lines = '';
$i = 1;

/** @var string $line */
foreach ($codeLines as $line) {
$trClass = '';
$popover = '';
@@ -555,6 +557,7 @@ private function renderSourceWithPathCoverage(FileNode $node): string

$lineData = [];

/** @var int $line */
foreach (array_keys($codeLines) as $line) {
$lineData[$line + 1] = [
'includedInPaths' => 0,
@@ -584,6 +587,7 @@ private function renderSourceWithPathCoverage(FileNode $node): string
$lines = '';
$i = 1;

/** @var string $line */
foreach ($codeLines as $line) {
$trClass = '';
$popover = '';
@@ -668,6 +672,7 @@ private function renderBranchLines(array $branch, array $codeLines, array $testD
$branchLines = range($branch['line_start'], $branch['line_end']);
sort($branchLines); // sometimes end_line < start_line

/** @var int $line */
foreach ($branchLines as $line) {
if (!isset($codeLines[$line])) { // blank line at end of file is sometimes included here
continue;
@@ -765,6 +770,7 @@ private function renderPathLines(array $path, array $branches, array $codeLines,
$branchLines = range($branches[$branchId]['line_start'], $branches[$branchId]['line_end']);
sort($branchLines); // sometimes end_line < start_line

/** @var int $line */
foreach ($branchLines as $line) {
if (!isset($codeLines[$line])) { // blank line at end of file is sometimes included here
continue;