@param string $operator operator
@param mixed  $value    value

@return Asserter
485227
public function create($operator, $value)
    {
        $this->operator = $operator;
        $this->value    = $value;

        return $this;
    }
286827
public static function parse($value)
    {
        if (\is_string($value)) {
            $operator = null;
            if (\strpos($value, AbstractMatcher::OPERATOR_AND)) {
                $operator = AbstractMatcher::OPERATOR_AND;
                $value = \explode(AbstractMatcher::OPERATOR_AND, $value);
            } elseif (\strpos($value, AbstractMatcher::OPERATOR_OR)) {
                $operator = AbstractMatcher::OPERATOR_OR;
                $value = \explode(AbstractMatcher::OPERATOR_OR, $value);
            } elseif (0 === \strpos($value, AbstractMatcher::OPERATOR_NOT)) {
                $value = [AbstractMatcher::OPERATOR_NOT => \substr($value, 1)];
            }
            if (null !== $operator) {
                return [
                    $operator => \array_map(
                        function ($val) {
                            return 0 === \strpos($val, AbstractMatcher::OPERATOR_NOT)
                                ? [AbstractMatcher::OPERATOR_NOT => \substr($val, 1)]
                                : $val;
                        },
                        $value
                    )
                ];
            }
        }

        return $value;
    }
635039
public static function findParamValue(&$value, &$operator): bool
    {
        if (is_array($value) || is_object($value)) {
            $value = static::assembleParamValue($value, $operator);
        } else {
            self::normalizeEmptyValue($value);

            $operator = self::parseParamOperator($value);

            if (is_numeric($value)) {
                $value = self::prependOperator($value, $operator);
            } else {
                $value = StringHelper::toLowerCase($value);

                if ($value !== ':empty:' || $value !== 'not :empty:') {
                    // Trim any whitespace from the value
                    $value = StringHelper::trim($value);

                    return false;
                }
            }
        }

        return true;
    }
340796
private static function findIdFromObjectArray($value, $operator = null)
    {
        if ($id = ArrayHelper::getValue($value, 'id')) {
            return self::prependOperator($id, $operator);
        }

        return $id;
    }
916399
protected function operatorForWhere($key, $operator, $value)
    {
        return function ($item) use ($key, $operator, $value) {
            $retrieved = data_get($item, $key);

            switch ($operator) {
                default:
                case '=':
                case '==':
                    return $retrieved == $value;
                case '!=':
                case '<>':
                    return $retrieved != $value;
                case '<':
                    return $retrieved < $value;
                case '>':
                    return $retrieved > $value;
                case '<=':
                    return $retrieved <= $value;
                case '>=':
                    return $retrieved >= $value;
                case '===':
                    return $retrieved === $value;
                case '!==':
                    return $retrieved !== $value;
            }
        };
    }
1022254
public function pullAll($field, $value, $operator = null)
    {
        return $this->pull($field, $value, $operator, true);
    }
887062
protected function prepareValueAndOperator($value, $operator)
    {
        if (is_null($value) && ! in_array($operator, ['='])) {
            $value = $operator;
            $operator = '=';
        } elseif (! in_array($operator, ['='])) {
            throw new \InvalidArgumentException('Illegal operator and value combination.');
        }

        if (is_null($value)) {
            $value = 'NULL';
            $operator = 'IS';
        } else {
            $value = compact('value');
        }

        return [$value, $operator];
    }
831728
protected function operatorForWhere(string $key, $operator, $value)
    {
        return function ($itemKey, $item) use ($key, $operator, $value) {
            $retrieved = self::dataGet($item, $key);

            switch ($operator) {
                default:
                case '=':
                case '==':
                    return $retrieved == $value;
                case '!=':
                case '<>':
                    return $retrieved != $value;
                case '<':
                    return $retrieved < $value;
                case '>':
                    return $retrieved > $value;
                case '<=':
                    return $retrieved <= $value;
                case '>=':
                    return $retrieved >= $value;
                case '===':
                    return $retrieved === $value;
                case '!==':
                    return $retrieved !== $value;
            }
        };
    }
282062
protected function getCorrectValue($operator, stdClass $rule, $value)
    {
        $field = $rule->field;
        $sqlOperator = $this->operator_sql[$rule->operator];
        $requireArray = $this->operatorRequiresArray($operator);

        $value = $this->enforceArrayOrString($requireArray, $value, $field);

        /*
        *  Turn datetime into Carbon object so that it works with "between" operators etc.
        */
        if ($rule->type == 'date') {
            $value = $this->convertDatetimeToCarbon($value);
        }

        return $this->appendOperatorIfRequired($requireArray, $value, $sqlOperator);
    }
603746
public function logicalOperator($operator = null)
    {
        if (is_null($operator)) {
            return $this->logicalOperator;
        }

        Helpers::ensureValidLogicalOperator($operator);

        $this->logicalOperator = $operator;

        return $this;
    }
120789
protected function bit(string $operator, int $value) : self
    {
        $this->requiresCurrentField();
        $this->newObj['$bit'][$this->currentField][$operator] = $value;
        return $this;
    }
450916
public function addAnd($value , $operator = null) {
        
        $param = new self();
        $param->setOperator($this->setDefaultOperator($operator))->setValue($value);
        $this->and[] = $param;
        return $this;
    }
217098
protected function buildOperatorWithValue($operator, $value)
    {
        $className = CriteriaBuilder::getOperatorClassNameBySqlOperator($operator);
        $Operator = $this->getFactoryWorker()->buildCriteriaOperator($className);

        return $this->replaceOperatorForNulLValue($Operator, $value);
    }
1333700
protected static function parseComparisonOperator($value, $is_negation)
    {
        if (preg_match('/^\((gt|ge|lt|le)\)(.+)$/', $value, $match)) {
            $operator = null;
            switch ($match[1]) {
                case 'gt':
                    $operator = $is_negation ? static::OPERATOR_LESS_EQUAL : static::OPERATOR_GREATER;
                    break;
                case 'ge':
                    $operator = $is_negation ? static::OPERATOR_LESS : static::OPERATOR_GREATER_EQUAL;
                    break;
                case 'lt':
                    $operator = $is_negation ? static::OPERATOR_GREATER_EQUAL : static::OPERATOR_LESS;
                    break;
                case 'le':
                    $operator = $is_negation ? static::OPERATOR_GREATER : static::OPERATOR_LESS_EQUAL;
                    break;
            }

            $value = $match[2];

            return [$operator, $value];
        }

        return false;
    }
444233
public static function make($value)
    {
        $value = static::prepareValue($value);
        $is_negation = static::parseIsNegation($value);
        list($operator, $value) = static::parseOperatorAndValue($value, $is_negation);

        return new static($operator, $value, $is_negation);
    }
884235
public function operator($operator, $value)
    {
        $this->wrapEqualityCriteria();

        if ($this->currentField) {
            $this->query[$this->currentField][$operator] = $value;
        } else {
            $this->query[$operator] = $value;
        }
        return $this;
    }
636147
private function resolveOperator($symbol, $value)
    {
        if (null === $symbol) {
            return $this->getOperatorByValueType($value);
        }

        return self::$operatorMap[$symbol];
    }