Skip to content

Commit 6708c78

Browse files
committed
Revert "Fix Concat operations with variables #953"
This reverts commit d457c77.
1 parent bcea86c commit 6708c78

File tree

3 files changed

+0
-38
lines changed

3 files changed

+0
-38
lines changed

src/StaticAnalysis/ExecutableLinesFindingVisitor.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,6 @@ private function getLines(NodeAbstract $node, bool $fromReturns): array
166166
}
167167

168168
if ($node instanceof BinaryOp) {
169-
if ($node instanceof BinaryOp\Concat &&
170-
(
171-
$node->left instanceof Node\Expr\Variable ||
172-
$node->right instanceof Node\Expr\Variable
173-
)) {
174-
return [$this->getNodeStartLine($node->right)];
175-
}
176-
177169
return $fromReturns ? $this->getLines($node->right, $fromReturns) : [];
178170
}
179171

tests/_files/source_with_multiline_constant_return.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -492,29 +492,6 @@ public function unaryMinusNowdoc(): float
492492
;
493493
}
494494

495-
public function concatWithVar(): string
496-
{
497-
$var1 = 'start';
498-
499-
$var1 =
500-
<<<'EOF'
501-
right
502-
EOF
503-
.
504-
$var1
505-
;
506-
507-
$var1 =
508-
$var1
509-
.
510-
<<<'EOF'
511-
left
512-
EOF
513-
;
514-
515-
return $var1;
516-
}
517-
518495
public
519496
function
520497
emptyMethod

tests/tests/Data/RawCodeCoverageDataTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,6 @@ public function testReturnStatementWithConstantExprOnlyReturnTheLineOfLast(): vo
499499
456,
500500
466,
501501
478,
502-
490,
503-
498,
504-
500,
505-
505,
506-
508,
507-
512, // This is correct: not the line with the $var1, but the right operand of the Concat
508-
516,
509502
527,
510503
],
511504
array_keys(RawCodeCoverageData::fromUncoveredFile($file, new ParsingFileAnalyser(true, true))->lineCoverage()[$file])

0 commit comments

Comments
 (0)