protected function castString(string $value)
    {
        $val = trim($value);

        if (!is_numeric($val) && $val !== '') {
            return $this->dontCast($value);
        }

        $type = strpos($this->type, '|') !== false ? (strpos($val, '.') !== false ? 'float' : 'integer') : $this->type;
        settype($val, $type);

        return $val;
    }