PDepend\Source\Language\PHP\AbstractPHPParser::reduceUnaryExpression PHP Method

reduceUnaryExpression() private method

Reduces all unary-expressions in the given expression list.
Since: 0.10.0
private reduceUnaryExpression ( array $expressions ) : PDepend\Source\AST\ASTExpression[]
$expressions array Unprepared input array with parsed expression nodes found in the source tree.
return PDepend\Source\AST\ASTExpression[]
    private function reduceUnaryExpression(array $expressions)
    {
        for ($i = count($expressions) - 2; $i >= 0; --$i) {
            $expr = $expressions[$i];
            if ($expr instanceof \PDepend\Source\AST\ASTUnaryExpression) {
                $child = $expressions[$i + 1];
                $expr->addChild($child);
                $expr->configureLinesAndColumns($expr->getStartLine(), $child->getEndLine(), $expr->getStartColumn(), $child->getEndColumn());
                unset($expressions[$i + 1]);
            }
        }
        return array_values($expressions);
    }
AbstractPHPParser