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;
    }
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;
    }
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 ; }
Find expressions by its name, string representation, operator, class or operand.

@param array $attributes
@param array $expressions (optional)

@return array
Find expressions by its name string representation operator class or operand .