This commit is contained in:
as2252258@163.com
2021-08-06 00:50:25 +08:00
parent 7e84d06c57
commit d8cec79b3e
4 changed files with 13 additions and 37 deletions
+3 -12
View File
@@ -21,7 +21,7 @@ use Snowflake\Snowflake;
* Class HttpParams
* @package Snowflake\Snowflake\Http
*/
class HttpParams
trait HttpParams
{
/** @var array|null */
@@ -109,7 +109,7 @@ class HttpParams
*/
private function page(): int
{
return (int)$this->get('page', 1);
return (int)$this->query('page', 1);
}
@@ -129,19 +129,10 @@ class HttpParams
*/
public function size(): int
{
return (int)$this->get('size', 20);
return (int)$this->query('size', 20);
}
/**
* @param $name
* @param null $defaultValue
* @return mixed
*/
public function get($name, $defaultValue = null): mixed
{
return $this->_gets[$name] ?? $defaultValue;
}
/**
* @param $name