Determine if the given operator is supported.

@param  string  $operator
@return bool
342917
protected function invalidOperator($operator)
    {
        return ! in_array(strtolower($operator), $this->operators, true) &&
               ! in_array(strtolower($operator), $this->grammar->getOperators(), true);
    }
614914
private function supports($object)
    {
        if ($object instanceof ObjectCollection) {
            return $object->isInstanceOf($this->getClass());
        } else {
            //doctrine sends proxy so we have to do the check with the instanceof operator
            $rc = new \ReflectionClass($this->getClass());
            $toCheck = $rc->newInstanceWithoutConstructor();

            return $object instanceof $toCheck;
        }
    }
1296114
public function every($key, $operator = null, $value = null)
    {
        if (func_num_args() === 1) {
            $callback = $this->valueRetriever($key);

            foreach ($this->items as $k => $v) {
                if (!$callback($v, $k)) {
                    return false;
                }
            }

            return true;
        }

        if (func_num_args() === 2) {
            $value = $operator;

            $operator = '=';
        }

        return $this->every($this->operatorForWhere($key, $operator, $value));
    }
567973
protected function convertOperation($expr1, $operator, $expr2)
	{
		$expr1 = $this->convert($expr1);
		$expr2 = $this->convert($expr2);

		// Prevent two consecutive minus signs to be interpreted as a post-decrement operator
		if ($operator === '-' && $expr2[0] === '-')
		{
			$operator .= ' ';
		}

		return $expr1 . $operator . $expr2;
	}
1329821
public function hasLowerPriority(Operator $o)
    {
        $hasLowerPriority = ((Operator::O_LEFT_ASSOCIATIVE == $o->getAssociativity()
                            && $this->getPriority() == $o->getPriority())
                            || $this->getPriority() < $o->getPriority());


        return $hasLowerPriority;
    }
198629
public function whyCantDo($operation)
    {
        if (!is_string($operation)) {
            return 'Invalid $operation';
        }
        if (!isset($this->operationErrors[$operation])) {
            switch ($operation) {
                case static::OPERATION_MOVE:
                    $error = $this->whyCantMove();
                    break;
                case static::OPERATION_ALIAS:
                    $error = $this->whyCantAlias();
                    break;
                case static::OPERATION_COPY:
                    $error = $this->whyCantCopy();
                    break;
                case static::OPERATION_COPYALL:
                    $error = $this->whyCantDo(static::OPERATION_COPY);
                    if ($error === '') {
                        $error = $this->whyCantCopyAll();
                    }
                    break;
                case static::OPERATION_COPYVERSION:
                    $error = $this->whyCantCopyVersion();
                    break;
                default:
                    return 'Invalid $operation';
            }
            $this->operationErrors[$operation] = $error;
        }

        return $this->operationErrors[$operation];
    }
253978
public function removeOperator(string $operator): self
    {
        $this->validateOperator($operator);
        if (false !== ($key = array_search($operator, $this->operators))) {
            unset($this->operators[$key]);
        }

        return $this;
    }
112292
public function isApplicable($object)
    {
        foreach ($this->_applicableClasses as $className) { 
            if ($object instanceof $className) {
                return true;
            }
        }
        
        return false;
    }
234361
static public function isValid($operator, $throwException = false)
    {
        $operator = intval($operator);
        if ($operator > 0 && $operator <= static::IS_NOT_NULL) {
            return true;
        }

        if ($throwException) {
            throw new InvalidArgumentException('Unexpected filter operator.');
        }

        return false;
    }
516984
public function supports($feature)
    {
        if (!$this->controller) {
            return false;
        }

        $s = 'support'.$feature;

        return $this->controller->$s;
    }
1264619
public function can($permission, $operator = null)
    {
        // user permissions including
        // all of user role permissions
        $merge =  \Cache::remember(
            'acl.getMergeById_'.$this->id,
            config('acl.cacheMinutes'),
            function () {
                return $this->getPermissions();
            }
        );

        // lets call our base can() method
        // from role class. $merge already
        // has user & role permissions
        $model = config('acl.role', 'Kodeine\Acl\Models\Eloquent\Role');

        return (new $model)->can($permission, $operator, $merge);
    }
645286
protected function processTokenLogicalOperator($operator)
    {
        if (null === $this->scope->getNode()) {
            $this->addError('Logical operator must be preceded by a valid operation.', self::ERROR_CODE_LOGICAL_OPERATOR_PRECEDED);
        } else {
            if (self::LOGICAL_OR === $operator) {
                if (null !== $this->scope->getLastOrNode()) {
                    /*
                     * If a `or` node was already registered, we create a new
                     * boolean node to join the two nodes.
                     */
                    $node = new BooleanNode($this->scope->getLastOrNode(), $this->scope->getNode(), $operator);
                    $this->scope->setNode($node);
                }

                $this->scope->setLastOrNode($this->scope->getNode());
            } else {
                $this->scope
                    ->setCurrentLeftNode($this->scope->getNode())
                    ->deleteNode();
            }

            $this->scope
                ->setCurrentOperator($operator)
                ->shiftExpression();
        }
    }
227924
public static function isSupported($encoding, $convertEncoding = null)
    {
        $supportedEncodings = static::getSupportedEncodings();

        if (!in_array(strtoupper($encoding), $supportedEncodings)) {
            return false;
        }

        if ($convertEncoding !== null && !in_array(strtoupper($convertEncoding), $supportedEncodings)) {
            return false;
        }

        return true;
    }
1302460
public function route(array $values, $operator)
    {
        if (!in_array($operator, array('=', '!='))) {
            return $this->translation->text('Unsupported operator');
        }

        $existing = $this->route->getList();

        foreach ($values as $pattern) {
            if (empty($existing[$pattern])) {
                return $this->translation->text('@name is unavailable', array(
                    '@name' => $this->translation->text('Condition')));
            }
        }

        return true;
    }
1025442
public static function compareSize($val, string $operator, $expected): bool
    {
        // type must be same
        if (\gettype($val) !== \gettype($expected)) {
            return false;
        }

        // not in: int, string, array
        if (($len = self::length($val)) < 0) {
            return false;
        }

        $wantLen = self::length($expected);

        switch ($operator) {
            case '>':
                $ok = $len > $wantLen;
                break;
            case '>=':
                $ok = $len >= $wantLen;
                break;
            case '<':
                $ok = $len < $wantLen;
                break;
            case '<=':
                $ok = $len <= $wantLen;
                break;
            default:
                $ok = false;
        }

        return $ok;
    }
94889
public function setOperator($operator)
    {
        if ($operator) {
            if (!$this->validateOperator($operator)) {
                throw new \InvalidArgumentException(\sprintf('Binding invalid operator "%s" into filter "%s"', $operator, $this->name));
            }
            $this->operator = $operator;
            $this->updateBound();
        }

        return $this;
    }
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;
    }