Skip to content

Commit 3b9a480

Browse files
Slamdunksebastianbergmann
authored andcommitted
If condition to return statement
1 parent cc0d350 commit 3b9a480

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/StaticAnalysis/ExecutableLinesFindingVisitor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ public function enterNode(Node $node): void
250250
return;
251251
}
252252

253-
if (!isset($this->executableLinesGroupedByBranch[$node->getStartLine()])) {
254-
$this->setLineBranch($node->getStartLine(), $node->getEndLine(), 1);
255-
253+
if (isset($this->executableLinesGroupedByBranch[$node->getStartLine()])) {
256254
return;
257255
}
256+
257+
$this->setLineBranch($node->getStartLine(), $node->getEndLine(), 1);
258258
}
259259

260260
public function afterTraverse(array $nodes): void

tests/_files/source_for_branched_exec_lines.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,9 @@ function // 0
404404
void // 0
405405
{ // 0
406406
}; // +5
407+
$myf = function(){ $var = 1;}; // -5
407408
}
408-
public function withArrowFn() // +1
409+
public function withArrowFn() // +6
409410
{ // 0
410411
$y = 1; // 0
411412
$fn1 = fn($x) => $x + $y; // 0

0 commit comments

Comments
 (0)