Attempt to get a numeric value from an object array.
@param $value
@param null $operator
@return mixed|string

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

        return $id;
    }
687282
public function getNumber($command, $target = null, $value = null)
    {
        $string = $this->getString($command, $target, $value);

        return (int) $string;
    }
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;
    }
689839
public static function where($key, $operator, $value = null)
    {
        if (func_num_args() === 2) {
            $value = $operator;
            $operator = '=';
        }

        if (! isset(static::$countries['longlist'])) {
            static::$countries['longlist'] = json_decode(static::getFile(__DIR__.'/../resources/data/longlist.json'), true);
        }

        return static::filter(static::$countries['longlist'], static::operatorForWhere($key, $operator, $value));
    }
1041174
public function value($value = null)
    {
        if (func_num_args() === 0) {
            return $this->_data['value'];
        }
        $value = (string) $value;
        return $this->_data['value'] = $value;
    }
294260
protected function match($operator, $pattern, $value)
    {
        $value   = strtolower($value);
        $pattern = strtolower($pattern);
        switch ($operator) {
            case '=':
                return $value === $pattern;
            case '!=':
                return $value !== $pattern;
            case '^=':
                return preg_match('/^'.preg_quote($pattern, '/').'/', $value);
            case '$=':
                return preg_match('/'.preg_quote($pattern, '/').'$/', $value);
            case '*=':
                if ($pattern[0] == '/') {
                    return preg_match($pattern, $value);
                }

                return preg_match("/".$pattern."/i", $value);
        }

        return false;
    }
820620
public function where($key, $operator = null, $value = null)
    {
        // If two params are given then assume operator is =
        if (func_num_args() == 2) {
            $value = $operator;
            $operator = '=';
        }
        return $this->whereHandler($key, $operator, $value);
    }
1291139
protected function getValue($value)
    {
        if (is_numeric($value)) {
            return false !== strpos('.', $value) ? (double)$value : (int)$value;
        }
        return $value;
    }
148225
protected function getValueDescription($value)
    {
        switch (true) {
            case (is_numeric($value)):
                $value = strval($value);
                break;

            case (is_bool($value) && $value):
                $value = '(boolean) true';
                break;

            case (is_bool($value) && !$value):
                $value = '(boolean) false';
                break;

            case (is_null($value)):
                $value = 'null value';
                break;

            default:
                break;
        }

        return $value;
    }
531631
protected function operatorForWhere($key, $operator = null, $value = null)
    {
        if (func_num_args() === 1) {
            $value = true;

            $operator = '=';
        }

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

            $operator = '=';
        }

        return function ($item) use ($key, $operator, $value) {
            $retrieved = data_get($item, $key);

            $strings = array_filter([$retrieved, $value], function ($value) {
                return is_string($value) || (is_object($value) && method_exists($value, '__toString'));
            });

            if (count($strings) < 2 && count(array_filter([$retrieved, $value], 'is_object')) == 1) {
                return in_array($operator, ['!=', '<>', '!==']);
            }

            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;
            }
        };
    }
234711
function checkType($value)
    {
        if( $this->type !== null ) {
            // check type constraints
            if( $this->isTypeInteger() ) {
                if( ! is_numeric($value) )
                    throw new NonNumericException;
                $value = (int) $value;
            }
        }
        return $value;
    }
82911
protected static function parseNullOperator($value, $is_negation)
    {
        if ($value === '(null)') {
            $operator = $is_negation ? static::OPERATOR_NOT_NULL : static::OPERATOR_NULL;

            return [$operator, null];
        }

        return false;
    }
970929
public function where($key, $operator, $value = null)
    {
        if (func_num_args() == 2) {
            $value = $operator;

            $operator = '=';
        }

        $countries = method_exists($this, 'where'.ucfirst($key))
            ? $this->{'where'.ucfirst($key)}($value)
            : parent::where($key, $operator, $value);

        return $this->hydrateDefaultElements($countries);
    }
162113
protected function operatorForWhere($key, $operator, $value)
    {
        return function ($item) use ($key, $operator, $value) {

            $retrieved = ArrayHelper::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);
    }
109343
public function value($field, $operator, $value)
    {
        return $this->middleware($field, $this->get($field), $operator, $value);
    }
262924
public function decode(string $value): ?int
    {
        $value = $this->hashids->decode($value);

        if (is_array($value) && sizeof($value) > 0) {
            return $value[0];
        } else {
            return null;
        }
    }