diff --git a/src/collector/backend/parser/UnitCollectingVisitor.php b/src/collector/backend/parser/UnitCollectingVisitor.php index 270fef31..70d0753b 100644 --- a/src/collector/backend/parser/UnitCollectingVisitor.php +++ b/src/collector/backend/parser/UnitCollectingVisitor.php @@ -482,6 +482,16 @@ private function resolveExpressionValue(Expr $expr) { ); } + if ($expr instanceof BinaryOp) { + $code = (new \PhpParser\PrettyPrinter\Standard)->prettyPrint([$expr]); + + return array( + 'type' => 'expression', + 'value' => substr($code,0,-1) + ); + + } + $type = get_class($expr); $line = $expr->getLine(); $file = $this->result->getFileName(); diff --git a/tests/data/issue313/src/bug.php b/tests/data/issue313/src/bug.php new file mode 100644 index 00000000..2f23208b --- /dev/null +++ b/tests/data/issue313/src/bug.php @@ -0,0 +1,7 @@ + + + + + + + + + + + + + + +