Parse a given undefined type value

@param  string $value
@param  null   $annotation Unused
@return mixed
540961
public function parse($value, $annotation = null)
    {
        if ('' === $value) return true; // implicit boolean

        $json = JsonType::jsonDecode($value);

        if (JSON_ERROR_NONE === json_last_error()) {
            return $json;
        }
        elseif (false !== ($int = filter_var($value, FILTER_VALIDATE_INT))) {
            return $int;
        }
        elseif (false !== ($float = filter_var($value, FILTER_VALIDATE_FLOAT))) {
            return $float;
        }

        return $value;
    }
569831
protected function validateNull($value, ValidationField $field) {
        if ($value === null) {
            return null;
        }
        $field->addError('type', ['messageCode' => 'The value should be null.', 'type' => 'null']);
        return Invalid::value();
    }
878077
public function parse($value, $type = NULL, &$position = NULL, $fmt, $value, $type = NULL, &$position = NULL)
    {
    }
17203
protected function getSanitizedValue($value)
    {
        $validation_result = $this->getValidator()->validate($value);

        if ($validation_result->getSeverity() > IncidentInterface::NOTICE) {
            throw new BadValueException(
                sprintf(
                    "Given value for attribute '%s' on entity type '%s' is not valid.",
                    $this->getName(),
                    $this->getType() ? $this->getType()->getName() : 'undefined'
                )
            );
        }

        return $validation_result->getSanitizedValue();
    }
644651
private function normalizeAnnotation(Annotation $annotation)
    {
        return [
            'value' => $annotation->getValue(),
            'timestamp' => $annotation->getTimestamp(),
            'endpoint' => null !== $annotation->getHost() ? $this->normalizeEndpoint($annotation->getHost()) : null,
        ];
    }
1018847
private function parseValue($value)
    {
        if (substr($value, 0, 1) === '"' && substr($value, -1, 1) === '"') {
            return substr($value, 1, -1);
        }

        if ($value === 'null') {
            return null;
        }

        throw new LogicException(sprintf('Can\'t parse the value: "%s"', $value));
    }
1140331
private function getAnnotationParameter($value)
    {
        $annotation = AnnotationParser::getAnnotation();


        return $annotation->directParse($value)
            ->execute()[$this->command][0];
    }
979822
public Object parse(String value, Class type)
    {
        if (StringUtil.isBlank(value))
        {
            return null;
        }

        return doConvert(value.trim(), type);
    }
766470
public function parse($value, $annotation = null)
    {
        $json = static::jsonDecode($value);
        if (JSON_ERROR_NONE != json_last_error()) {
            throw new ParserException("Raw value must be a valid JSON string. Invalid value '{$value}' given.");
        }

        return $json;
    }
92705
public function parse($value)
    {
        $locale = $this->params['locale'];
        //$formatterId = md5($locale);
        $formatterId = $locale;
        if (!array_key_exists($formatterId, $this->formatters)) {
            $this->loadFormatterId($formatterId);
        }
        // Currency will be passed as reference
        // setting it to null prevent eventual warning
        $currency = null;
        $result = $this->formatters[$formatterId]->parseCurrency($value, $currency);

        if ($result === false) {
            return null;
        }

        return ['value' => $result, 'currency' => $currency];
    }
1192589
public function parse($value, $annotation = null)
    {
        if (false === ($value = filter_var($value, FILTER_VALIDATE_FLOAT))) {
            throw new ParserException("Raw value must be float. Invalid value '{$value}' given.");
        }

        return $value;
    }
902107
private function allowedValues(Annotation $annotation): array
    {
        if ($annotation->hasValueByName('allowed')) {
            return array_map('trim', explode('|', $annotation->getAllowed()));
        } elseif ($annotation->hasValueByName('allowedSource')) {
            return call_user_func(array_map('trim', explode(
                    '::',
                    str_replace('()', '', $annotation->getAllowedSource())
            )));
        }

        throw new \RuntimeException(
                'No list of allowed values in annotation @Request[OneOf] on '
                . $annotation->target()
        );
    }
1289026
private function parseDate(Annotation $annotation, string $field)
    {
        if ($annotation->hasValueByName($field)) {
            return new Date($annotation->getValueByName($field));
        }

        return null;
    }
87414
public static function fromValue($value)
    {
        foreach (static::values() as $key => $enumInstance) {
            if ($enumInstance->getValue() === $value) {
                return $enumInstance;
            }
        }

        return null;
    }
637378
function parse(string $value, \CharlotteDunois\Livia\Commands\Context $context, ?\CharlotteDunois\Livia\Arguments\Argument $arg = null) {
        $prg = \preg_match('/(?:<@&)?(\d{15,})>?/', $value, $matches);
        if($prg === 1) {
            return $context->message->guild->roles->get($matches[1]);
        }
        
        $search = \mb_strtolower($value);
        
        $inexactRoles = $context->message->guild->roles->filter(function ($role) use ($search) {
            return (\mb_stripos($role->name, $search) !== false);
        });
        $inexactLength = $inexactRoles->count();
        
        if($inexactLength === 0) {
             return null;
        }
        if($inexactLength === 1) {
            return $inexactRoles->first();
        }
        
        $exactRoles = $context->message->guild->roles->filter(function ($role) use ($search) {
            return ($role->name === $search);
        });
        $exactLength = $exactRoles->count();
        
        if($exactLength === 1) {
            return $exactRoles->first();
        }
        
        return null;
    }
1316769
protected function _parseBindValue($value, $preservedStrLength)
    {
        if (is_string($value)) {
            $quoted = $this->_quote($value);
            if ($preservedStrLength > 0 && strlen($quoted) >= $preservedStrLength) {
                return substr($quoted, 0, $preservedStrLength) . '...';
            } else {
                return $quoted;
            }
        } elseif (is_int($value)) {
            return $value;
        } elseif ($value === null) {
            return 'NULL';
        } elseif (is_bool($value)) {
            return (int)$value;
        } else {
            return $value;
        }
    }
1236119
protected function parse(string $value = null):?string{

		if($value !== null){

			$q = $value[0] ?? null;

			$value = in_array($q, ["'", '"'], true)
				// handle quoted strings
				? preg_replace("/^$q((?:[^$q\\\\]|\\\\\\\\|\\\\$q)*)$q.*$/mx", '$1', $value)
				// skip inline comments
				: trim(explode('#', $value, 2)[0]);

			// handle multiline values
			$value = implode(PHP_EOL, explode('\\n', $value));

			// handle nested ${VARS}
			if(strpos($value, '$') !== false){
				$value = preg_replace_callback('/\${(?<var>[_a-z\d]+)}/i', function($matches){
					return $this->get($matches['var']);
				}, $value);
			}

		}

		return $value;
	}