src/Bundle/Common/Bag/ValueBag.php
public function fetch(string $key, $default = null)
    {
        $val = $this->bag[$key] ?? $default;
        if (!is_array($val)) {
            return trim($val);
        } else {
            return $val;
        }
    }
public function fetch(string $key, $default = null)
    {
        $val = $this->bag[$key] ?? $default;
        if (!is_array($val)) {
            return trim($val);
        } else {
            return $val;
        }
    }
Get value by parameter name.

@param string $key
@param mixed|null $default The default value if parameter does not exist
@return mixed|null