lib/Doctrine/MongoDB/Aggregation/Expr.php
public static function convertExpression($expression)
    {
        if (is_array($expression)) {
            return array_map(['static', 'convertExpression'], $expression);
        } elseif ($expression instanceof self) {
            return $expression->getExpression();
        }

        return $expression;
    }
public static function convertExpression($expression)
    {
        if (is_array($expression)) {
            return array_map(['static', 'convertExpression'], $expression);
        } elseif ($expression instanceof self) {
            return $expression->getExpression();
        }

        return $expression;
    }
public static function convertExpression ( $ expression ) { if ( is_array ( $ expression ) ) { return array_map ( [ 'static' , 'convertExpression' ] , $ expression ) ; } elseif ( $ expression instanceof self ) { return $ expression -> getExpression ( ) ; } return $ expression ; }
Converts an expression object into an array, recursing into nested items

For expression objects, it calls getExpression on the expression object.
For arrays, it recursively calls itself for each array item. Other values
are returned directly.

@param mixed|self $expression
@return string|array
@internal
Converts an expression object into an array recursing into nested items