Skip to content

Commit

Permalink
feat(Http): 增加 Http::request 方法,替代 wei()->http
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Apr 15, 2023
1 parent c1a6502 commit da33434
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 52 deletions.
104 changes: 52 additions & 52 deletions docs/auto-completion-static.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ public static function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -208,13 +207,12 @@ public static function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -352,13 +350,12 @@ public static function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -682,13 +679,12 @@ public static function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -949,13 +945,12 @@ public static function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -1033,6 +1028,17 @@ class Gravatar

class Http
{
/**
* Create a new HTTP object and execute
*
* @param array|string $url A options array or the request URL
* @param array $options A options array if the first parameter is string
* @return $this A new HTTP object
* @see Http::request
*/
public static function request($url = null, array $options = []): self
{
}
}

class IsAll
Expand Down Expand Up @@ -2733,13 +2739,12 @@ public static function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -2877,13 +2882,12 @@ public static function getMultiple(iterable $keys, $default = null): iterable
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -3168,13 +3172,12 @@ public static function getBack(): BaseCache
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -3308,13 +3311,12 @@ public static function incr($key, $offset = 1)
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -3512,13 +3514,12 @@ public static function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -3937,10 +3938,10 @@ public static function rightJoin(
* Replaces any previously specified restrictions, if any.
*
* ```php
* $user = wei()->db('user')->where('id = 1');
* $user = wei()->db('user')->where('id = ?', 1);
* $users = wei()->db('user')->where(array('id' => '1', 'username' => 'twin'));
* $users = wei()->where(array('id' => array('1', '2', '3')));
* $user = QueryBuilder::table('user')->where('id', 1);
* $users = QueryBuilder::table('user')->where('id', '>', 1);
* $users = QueryBuilder::table('user')->where(['id' => '1', 'username' => 'twin']);
* $users = QueryBuilder::table('user')->where(['id' => ['1', '2', '3']]);
* ```
*
* @param array|Closure|string|null $column
Expand Down Expand Up @@ -4388,13 +4389,12 @@ public static function setMultiple(iterable $keys, $ttl = null): bool
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -7010,13 +7010,12 @@ public function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -7154,13 +7153,12 @@ public function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -7298,13 +7296,12 @@ public function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -7628,13 +7625,12 @@ public function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -7895,13 +7891,12 @@ public function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -7979,6 +7974,17 @@ class Gravatar

class Http
{
/**
* Create a new HTTP object and execute
*
* @param array|string $url A options array or the request URL
* @param array $options A options array if the first parameter is string
* @return $this A new HTTP object
* @see Http::request
*/
public function request($url = null, array $options = []): self
{
}
}

class IsAll
Expand Down Expand Up @@ -9679,13 +9685,12 @@ public function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -9823,13 +9828,12 @@ public function getMultiple(iterable $keys, $default = null): iterable
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -10114,13 +10118,12 @@ public function getBack(): BaseCache
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -10254,13 +10257,12 @@ public function incr($key, $offset = 1)
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -10458,13 +10460,12 @@ public function clear()
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down Expand Up @@ -10871,10 +10872,10 @@ public function rightJoin(string $table, string $first = null, string $operator
* Replaces any previously specified restrictions, if any.
*
* ```php
* $user = wei()->db('user')->where('id = 1');
* $user = wei()->db('user')->where('id = ?', 1);
* $users = wei()->db('user')->where(array('id' => '1', 'username' => 'twin'));
* $users = wei()->where(array('id' => array('1', '2', '3')));
* $user = QueryBuilder::table('user')->where('id', 1);
* $users = QueryBuilder::table('user')->where('id', '>', 1);
* $users = QueryBuilder::table('user')->where(['id' => '1', 'username' => 'twin']);
* $users = QueryBuilder::table('user')->where(['id' => ['1', '2', '3']]);
* ```
*
* @param array|Closure|string|null $column
Expand Down Expand Up @@ -11322,13 +11323,12 @@ public function setMultiple(iterable $keys, $ttl = null): bool
* Retrieve an item
*
* ```php
* $cache = wei()->cache;
*
* // Retrieve cache by key
* $cache->get('key');
*
* // Custom default value
* $cache->get('key', 'default value');
* ```
*
* @param string $key The name of item
* @param mixed $default The default value to return when cache not exists
Expand Down
Loading

0 comments on commit da33434

Please sign in to comment.