Leave only not empty values to work with

@param $params
182676
protected static function filterInput(&$params)
    {
        $params = array_filter($params, function ($v) {
            if (true === is_array($v)) {
                $first = reset($v);
                return (count($v) > 0 && false === empty($first));
            } else {
                return false === empty($v);
            }
        });
    }
520862
public function setParams($params): void
    {
        if (! \is_array($params) && ! $params instanceof \ArrayAccess) {
            throw new \InvalidArgumentException('Event params are invalid. Expected type is array or \\ArrayAccess. Got ' . \gettype($params));
        }

        $this->params = $params;
    }
1141832
function _setParams( $params, $defaults=FALSE ) {
    if( !is_array( $params))
      $params = array();
    $input = array();
    foreach( $params as $paramKey => $paramValue ) {
      if( is_array( $paramValue )) {
        foreach( $paramValue as $pkey => $pValue ) {
          if(( '"' == substr( $pValue, 0, 1 )) && ( '"' == substr( $pValue, -1 )))
            $paramValue[$pkey] = substr( $pValue, 1, ( strlen( $pValue ) - 2 ));
        }
      }
      elseif(( '"' == substr( $paramValue, 0, 1 )) && ( '"' == substr( $paramValue, -1 )))
        $paramValue = substr( $paramValue, 1, ( strlen( $paramValue ) - 2 ));
      if( 'VALUE' == strtoupper( $paramKey ))
        $input['VALUE']                 = strtoupper( $paramValue );
      else
        $input[strtoupper( $paramKey )] = $paramValue;
    }
    if( is_array( $defaults )) {
      foreach( $defaults as $paramKey => $paramValue ) {
        if( !isset( $input[$paramKey] ))
          $input[$paramKey] = $paramValue;
      }
    }
    return (0 < count( $input )) ? $input : null;
  }
1101157
public function setAllParams(array $params)
    {
        foreach ($params as $key => $value) {
            $this->setParam($key, $value);
        }

        return $this;
    }
1181389
public function setParams($params)
    {
        if (is_array($params) && isset($params['application'])) {
            $this->setApplicationEntity($params['application']);
            unset($params['application']);
        } elseif (is_object($params) && isset($params->application)) {
            $this->setApplicationEntity($params->application);
        }

        if (is_array($params) && isset($params['user'])) {
            $this->setUser($params['user']);
            unset($params['user']);
        }

        if (is_array($params) && isset($params['status'])) {
            $this->setStatus($params['status']);
            unset($params['status']);
        }

        return parent::setParams($params);
    }
253618
public function setSiteParameters($params)
    {
        foreach ($params as $key => $param) {
            $this->setSiteParameter($key, $param);
        }

        return $this;
    }
459951
protected function clearValues()
    {
        $this->values = [];
        foreach ($this->fields as $name => $syntax) {
            $this->values[$name] = (object) [
                'value'   => null,
                'error'   => static::MISSING_FIELD
            ];
        }
    }
956413
private function setSaltFromParams(array $params)
    {
        $salt = $this->getMatchingData($params, '/^[\.\\A-Za-z0-9]{22}$/');
        $this->salt = (! empty($salt)) ? $salt : self::DEFAULT_SALT;
    }
798571
public function setParams(array $params = array())
    {
        foreach ($params as $key => $value) {
            if (null != $value) {
                $this->$key = $value;
            }
        }

        return $this;
    }
1285604
public function setSqlParameters(array $params)
    {
        $this->params = $params;

        $this->stmt = null;
        $this->rowCount = null;
    }
1332841
public function clear($params = [])
    {
        if (isset($params['level']) || isset($params['content'])) {
            $level = isset($params['level']) ? $params['level'] : '';
            $content = isset($params['content']) ? $params['content'] : '';
            $area = isset($params['area']) ? $params['area'] : '';
            $messages = $area ? (array)Session::get($this->id . '.' . $area) : (array)Session::get($this->id);

            $adjust = function ($messages) use ($content, $level) {
                $new = [];

                foreach ($messages as $message) {
                    if ($content && $level && $message['content'] != $content && $message['level'] != $level) {
                        $new[] = $message;
                    } else {
                        if ($content && !$level && $message['content'] != $content) {
                            $new[] = $message;
                        } else {
                            if (!$content && $level && $message['level'] != $level) {
                                $new[] = $message;
                            }
                        }
                    }
                }

                return $new;
            };

            if ($area) {
                Session::set($this->id . '.' . $area, $adjust($messages));
            } else {
                foreach ($messages as $area => $areaMessages) {
                    Session::set($this->id . '.' . $area, $adjust($areaMessages));
                }
            }
        } else {
            if (isset($params['area'])) {
                Session::clear($this->id . '.' . $params['area']);
            }
        }

        return $this;
    }
943028
protected function setQueryParams(array $params)
    {
        foreach ($params as $key => $value) {
            $this->setQueryParam($key, $value);
        }
    }
1315639
private function validateAndSetBotParamsExtra(array $params)
    {
        foreach (self::$valid_extra_bot_params as $extra_key) {
            if (!array_key_exists($extra_key, $params)) {
                continue;
            }

            $this->bot_params[$extra_key] = $params[$extra_key];
        }
    }
1305396
public function complete($params)
	{
		$requestParams = $this->initRequestParams('complete', $params);
		$this->request('complete', $requestParams);

		return empty($this->error);
	}
1087657
public function setParams($params)
    {
        if (!empty($params)) {
            foreach ($params as $key => $value) {
                $this->options[ 'json' ][ $key ] = $value;
            }
        }
        return $this;
    }
385129
public function setParams( $params )
    {
        if ( $params instanceof Traversable )
        {
            $params = iterator_to_array( $params );
        }
        else if ( is_object( $params ) && ! $params instanceof ArrayAccess )
        {
            $params = (array) $params;
        }

        return parent::setParams( $params );
    }
353409
protected function prepareParams($params)
    {
        if (isset($params['settings']['charset'])) {
            if (false === strpos($params['dsn'], ';charset=')) {
                $params['dsn'] .= ';charset=' . $params['settings']['charset'];
                unset($params['settings']['charset']);
            }
        }

        return parent::prepareParams($params);
    }