过滤传递的空参数

@param &$params

@return void
13924
protected function filterEmptyParams(&$params)
    {
        foreach ($params as $key => $item) {
            if (empty($item)) {
                unset($params[$key]);
            }
        }
    }
304596
protected function prepare($params = [])
    {
        if (null === $this->_statement) {
            $sqlCount = 'Db-Query:' . self::$_sqlCount++;
            try {
                $text = $this->getText();
                Timer::begin($sqlCount); // 记录DB开始时间
                $this->_statement = $this->getDb()
                    ->getPdoInstance()
                    ->prepare($text);
                if (empty($params)) {
                    $this->_statement->execute();
                } else {
                    $this->_statement->execute($params);
                }
                // 文件日志记录
                $this->getDb()->pushLog($sqlCount, [
                    'Sql' => $text,
                    'Params' => $params,
                ]);
            } catch (\Exception $e) {
                // 文件日志记录
                $this->getDb()->pushErrorLog($sqlCount, [
                    'Sql' => $this->getText(),
                    'Params' => $params,
                    'Error' => $e->getMessage(),
                    'Code' => $e->getMessage(),
                ]);
            }
        }
        return $this->_statement;
    }
1043870
protected function runConsole(array $params): void
    {
        $kernel = $this->app->make(KernelContract::class);

        $status = $kernel->handle(
            $input = new ArgvInput(array_values($params)),
            new ConsoleOutput()
        );

        $kernel->terminate($input, $status);

        exit($status);
    }
168723
public function delete($params)
    {
        $query = $this->query->delete($params);
        $this->db->exec($this->query->useQuery($params['db_name']));
        $prepare = $this->db->prepare($query);
        if ($prepare->execute()) {
            $prepare->closeCursor();

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

        $this->stmt = null;
        $this->rowCount = null;
    }
888304
protected function set_params( $params ) {
		$this->requirements_details_url = ! empty( $params['requirements_details_url'] ) ? esc_url( trim( (string) $params['requirements_details_url'] ) ) : $this->requirements_details_url;
		$this->version_compare_operator = ! empty( $params['version_compare_operator'] ) ? (string) $params['version_compare_operator'] : $this->version_compare_operator;
		$this->not_valid_actions        = ! empty( $params['not_valid_actions'] ) ? (array) $params['not_valid_actions'] : $this->not_valid_actions;
		$this->show_valid_results       = isset( $params['show_valid_results'] ) ? (bool) $params['show_valid_results'] : $this->show_valid_results;
	}
832130
public static function isEmpty(
        array $params,
        string $key
    ) {
        return empty(self::get($params, $key, null));
    }
10507
protected function _setInputParams(array &$params) {
        foreach ($params as $paramKey => $paramValue) {
            if (in_array($paramKey, $this->args, true)
                && !is_null($paramValue)
            ) {
                $this->_inputParams[$paramKey] = $paramValue;
            }
        }

        $this->_params = array_merge($this->_params, $this->_inputParams);
    }
952215
public function action_create( $params )
	{
		$name = array_shift( $params );
		
		$file = \DB\Migrator::path( $name );
		
		\CCFile::write( $file, "# ---> up\n\n\n\n# ---> down\n\n" );
	}
943028
protected function setQueryParams(array $params)
    {
        foreach ($params as $key => $value) {
            $this->setQueryParam($key, $value);
        }
    }
921764
public function start_ebs($params=null) {
		$parameters = array('id' => $this->id);		
		if($params) { $parameters['server[parameters]'] = $params; }
		$result = $this->executeCommand($this->_path_for_regex . '_start_ebs', $parameters);
	}
1176611
public function prepareParms($params)
    {
        if (is_array($params)) {
            foreach ($params as $key => $value) {
                array_push($this->setParams, $value);
            }
        } else {
            array_push($this->setParams, $params);
        }
    }
913116
protected function setParams(array $params) {
		parent::setParams($params);
		if($this->autoinc===true){
			$this->notNull=false;
		}
	}
534479
public function execute($params = null) {
		if ($params === null) {
			$params = [];
		}

		try {
			$this->stmt->execute($params);

			return new QueryResult($this->stmt, $this->pdo);
		} catch (PDOException $e) {
			throw $this->exAdapter->adapt($e, $this->stmt, $params);
		}
	}
869782
public function delete($params)
    {
        if (is_array($params)) {
            if (!empty($params['wheres'])) {
                $wheres = $this->prepareWhere($params['wheres']);
            } else {
                return false;
            }
            $query = "DELETE FROM `{$params['table']}` {$wheres};";
            if (isset($params['debug']) and strtolower($params['debug']) === 'on') {
                var_dump($query);
            }

            return $query;
        } else {
            return false;
        }
    }
1356140
public function emptyTrash($optParams = array())
  {
    $params = array();
    $params = array_merge($params, $optParams);
    return $this->call('emptyTrash', array($params));
  }
699807
public function init($param)
    {

        if (empty($param)) return false;

        $this->header = '';

        $param_list = new ParamList();
        foreach ($param as $key => $value) {
            if (property_exists($this, $key)) $this->$key = $value;
            elseif (property_exists($param_list, strtolower(str_replace('-', '_', $key)))) {
                if (is_string($value)) {
                    $this->header[] = new SingleParam($key, $value);
                } elseif (is_array($value)) {
                    $this->header[] = new MultiParam($key, $value);
                }
            }

        }


        return true;
    }