forked from GNUsocial/gnu-social
[HTTPClient] Add utility functions for all HTTP methods
This commit is contained in:
parent
4649ee9e71
commit
792a9f097c
@ -31,6 +31,9 @@ abstract class HTTPClient
|
|||||||
|
|
||||||
public static function __callStatic(string $name, array $args)
|
public static function __callStatic(string $name, array $args)
|
||||||
{
|
{
|
||||||
|
if (in_array(strtoupper($name), ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'])) {
|
||||||
|
return self::$client->request(strtoupper($name), ...$args);
|
||||||
|
}
|
||||||
return self::$client->{$name}(...$args);
|
return self::$client->{$name}(...$args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user