@param Expression|null[] $expressions

@return Expression|null[]
328643
final public static function cloneAll(array $expressions)
    {
        return array_map(
                function (Expression $expression = null) {
                    return $expression === null ? null : clone $expression;
                },
                $expressions
        );
    }
532677
public function expressions()
    {

        $expressions = [];

        if ($this->operand instanceof ExpressionContract) {
            $expressions[] = $this->operand;
        }

        if ($this->constraint instanceof ExpressionContract) {
            $expressions[] = $this->constraint;
        }

        return $expressions;

    }
731290
public function build(ExpressionInterface $expression, array &$params = [])
    {
        $array = [];
        foreach ($expression->getHash() as $key => $value) {
            $array[] = $key;
            $array[] = $value;
        }
        $arrayExp = new ArrayExpression($array, 'text');
        $callExp = new CallExpression('hstore', [$arrayExp]);

        return $this->queryBuilder->buildExpression($callExp, $params);
    }
655467
public function search($expression)
    {
        // Apply JMESPath expression on each result, but as a flat sequence.
        return flatmap($this, function (Result $result) use ($expression) {
            return (array) $result->search($expression);
        });
    }
389398
final public function value(string $expression): Collection\StringCollection
    {
        $items = $this->query($expression);
        $result = [];
        foreach ($items as $node) {
            $result[] = $node->nodeValue;
        }
        return new StringCollection($result);
    }
128166
@NonNull
    public ArrayExpressionSatisfies in(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new ArrayExpressionSatisfies(type, variable, expression);
    }
1264063
public function andX(array $expressions)
    {
        $expr = $this->createExpr();
        foreach ($expressions as $expression) {
            $expr->addAnd($expression);
        }

        return $expr;
    }
998870
public function valuesExpr($expression) {
		$args = func_get_args();
		$this->expression = array_shift($args);
		
		if (empty($args))
			return $this;
		
		//check if argument is a list
		try {
			$this->valuesArray($args[0]);
		}
		catch (\InvalidArgumentException $e) {
			$this->valueList = $args;
		}
		
		return $this;
	}
1316590
public function norX(array $expressions)
    {
        $self = $this;
        return function ($object) use ($self, $expressions) {
            $orX = $self->orX($expressions);
            return !$orX($object);
        };
    }
248056
private function ensureArray($expression)
    {
        if (is_array($expression)) {
            $array = array();
            foreach ($expression as $index => $value) {
                $array[$index] = $this->ensureArray($value);
            }

            return $array;
        } elseif ($expression instanceof self) {
            return $expression->getExpression();
        }

        return $expression;
    }
153048
protected function getAllFieldNames($expressions)
    {
        $fieldNames = [];
        foreach ($expressions as $expression) {
            if ($expression instanceof ConjunctionExpressionInterface) {
                $fieldNames = array_merge($fieldNames, $expression->getFieldNames());
            } elseif ($expression instanceof BasicExpressionInterface) {
                $fieldNames[] = $expression->getFieldName();
            }
        }

        return $fieldNames;
    }
273310
protected function findExpressions(array $attributes, $expressions=null)
    {

        $search = [
            'string'   => isset($attributes['string'])   ? $attributes['string']   : '*',
            'name'     => isset($attributes['name'])     ? $attributes['name']     : '*',
            'operator' => isset($attributes['operator']) ? $attributes['operator'] : '*',
            'operand'  => isset($attributes['operand'])  ? $attributes['operand']  : '*',
            'class'    => isset($attributes['class'])    ? $attributes['class']    : '*',
        ];

        $expressions = $expressions ?: $this->allExpressions();

        $matches = [];

        foreach ($expressions as $expression) {

            if ($this->matchesAttributes($expression, $search)) {
                $matches[] = $expression;
            }
        }

        return $matches;
    }
173893
public function getValueForOperand($expression)
    {
        if (is_array($expression)) {
            $result = [];
            foreach ($expression as $expressionEntry) {
                $result[] = $this->getValueForOperand($expressionEntry);
            }
            return $result;
        } elseif (is_numeric($expression)) {
            return $expression;
        } elseif ($expression === true) {
            return true;
        } elseif ($expression === false) {
            return false;
        } elseif ($expression === null) {
            return null;
        } elseif (strpos($expression, 'context.') === 0) {
            $objectAccess = explode('.', $expression, 3);
            $globalObjectsRegisteredClassName = $this->globalObjects[$objectAccess[1]];
            $globalObject = $this->objectManager->get($globalObjectsRegisteredClassName);
            $this->securityContext->withoutAuthorizationChecks(function () use ($globalObject, $objectAccess, &$globalObjectValue) {
                $globalObjectValue = $this->getObjectValueByPath($globalObject, $objectAccess[2]);
            });

            return $globalObjectValue;
        } else {
            return trim($expression, '"\'');
        }
    }
689115
protected function createMatchQuery($expression, array $fields = [])
    {
        if (0 == strlen($expression)) {
            return new Query\MatchAll();
        }

        if (empty($fields)) {
            $fields = $this->getDefaultMatchFields();
        }

        $query = new Query\MultiMatch();
        $query
            ->setQuery($expression)
            ->setFields($fields);

        return $query;
    }
184816
public function selectReduced( $expressions /* expressions ... */ ) {
		$expressions = is_array( $expressions ) ? $expressions : func_get_args();

		$this->setQueryForm( 'SELECT' );
		$this->uniqueness = 'REDUCED ';
		$this->addExpressions( $expressions );

		return $this;
	}
268520
public static function parse($expression)
    {
        $name = static::name($expression);

        if (preg_match_all('/\{\s*(.*?)\s*\}/', $expression, $matches)) {
            if (count($matches[1])) {
                return array_merge([$name], static::parameters($matches[1]));
            }
        }

        return [$name, [], []];
    }
1049725
public function setFilters(array $expressions): CopyDictionaryJob
    {
        $this->filters = [];
        foreach ($expressions as $expression) {
            $this->addFilter($expression);
        }

        return $this;
    }