Return param by name from $_POST or $_GET. Post priority

@param string $name
@param mixed|null $defaultValue

@return array|mixed|null
183148
private static function _getRequestParam($name, $defaultValue = null)
    {
        $value = $defaultValue;
        $request = Yii::$app->request;

        $get = $request->get($name, $defaultValue);
        $post = $request->post($name, $defaultValue);

        if ($post !== $defaultValue) {
            return $post;
        } elseif ($get !== $defaultValue) {
            return $get;
        }

        return $value;
    }
353886
public function getState($name,$defaultValue=null)
	{
		return isset($this->_state[$name])?$this->_state[$name]:$defaultValue;
	}
389003
public function get($name, $default = null)
    {
        $result = $default;
        if (isset($this->_data[$name])) {
            $result = $this->_data[$name]->value;
        }

        return $result;
    }
1344477
public function getValueByName(string $name, $default = null)
    {
        if (isset($this->values[$name])) {
            return $this->parseType($this->values[$name]);
        }

        return $default;
    }
1116022
public function hasGetPostParamValue($name, $ignoreCase = false)
    {
        $param = $this->hasGetParamValue($name, $ignoreCase);
        if ($param !== null)
        {
            return $param;
        }
        else
        {
            return $this->hasPostParamValue($name, $ignoreCase);
        }
    }
159385
protected function option($name, $defaultValue = null)
    {
        $value = $this->getInput()->getOption($name);

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

        return $value;
    }
1100391
public static function getValue($name)
    {
        if (array_key_exists($name, $_GET)) {
            return $_GET[$name];
        }
        if (array_key_exists($name, $_POST)) {
            return $_POST[$name];
        }
        return null;
    }
199202
public static function get($name, $default = '') {
        $_GET = self::paramFilter($_GET);
        if (isset($_GET[$name])) {
            if (empty($_GET[$name])) {
                return $default;
            }
            return $_GET[$name];
        }
        return false;
    }
355211
protected function getSettingValue($name, $defaultValue = NULL) {
		return TRUE === isset($this->settings[$name]) ? $this->settings[$name] : $defaultValue;
	}
630393
public function get($param = null, $defaultValue = null)
    {
        // return $this->getRequest()->get($param, $defaultValue);

        if ($param === null) {
            return $_REQUEST;
        }

        return isset($_REQUEST[$param]) ? $_REQUEST[$param] : $defaultValue;
    }
653633
public <R> R get(@NotNull final String name, R defaultValue) {
        if (context.containsKey(name)) {
            return get(name);
        } else {
            return defaultValue;
        }
    }
1261088
public function getSession($name = null, $defaultValue = null)
    {
        if ($name === null) {
            return $_SESSION;
        }
        return (isset($_SESSION[$name])) ? $_SESSION[$name] : $defaultValue;
    }
1139890
protected function getInlineOption($name, $str, $defaultValue)
	{
		if(preg_match('/'.$name.'(\s*=\s*(\d+))?/i', $str, $v) && count($v) > 2)
			return $v[2];
		else
			return $defaultValue;
	}
236876
public String getParam(@NotNull final String name, String defaultValue) {
        String value = getParam(name);

        if (value == null) {
            return defaultValue;
        }

        return value;
    }
1164570
private function _get($name, $default = null)
    {
        return array_key_exists($name, $this->getData()) ? $this->getData()[$name] : $default;
    }
1105795
public function post($name = null, $default = null)
    {
        if(null === $name)
        {
            return $this->post;
        }
        else
        {
            return $this->post[$name] ?? $default;
        }
    }
1256634
public function getValue($name, $default = null)
    {
        return isset($this->data[$name]) ? $this->data[$name] : $default;
    }