[HTTPClient] Add utility functions for all HTTP methods

This commit is contained in:
Hugo Sales 2021-04-25 21:16:24 +00:00
parent 1b8f5b7bf0
commit 5c78def973
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 3 additions and 0 deletions

View File

@ -31,6 +31,9 @@ abstract class HTTPClient
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);
}
}