From f809c8a4371a39ae3a2ff9a63d633fdb385929fe Mon Sep 17 00:00:00 2001 From: Eddie Kohler Date: Wed, 18 Nov 2020 08:43:38 -0500 Subject: [PATCH] Specify methods in types. --- lib/curls3result.php | 2 +- lib/s3client.php | 6 +++--- lib/s3result.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/curls3result.php b/lib/curls3result.php index c77da195a..7c33a0e39 100644 --- a/lib/curls3result.php +++ b/lib/curls3result.php @@ -25,7 +25,7 @@ class CurlS3Result extends S3Result { private $observed_success_timeout; /** @param string $skey - * @param string $method + * @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method * @param array $args * @param callable(S3Result):T $finisher */ function __construct(S3Client $s3, $skey, $method, $args, $finisher) { diff --git a/lib/s3client.php b/lib/s3client.php index 5b9545107..36d6461b0 100644 --- a/lib/s3client.php +++ b/lib/s3client.php @@ -89,7 +89,7 @@ function check_403() { } } - /** @param string $method + /** @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method * @param string $url * @param array $hdr * @return array{headers:list,signature:string} */ @@ -183,7 +183,7 @@ function signature($method, $url, $hdr) { } /** @param string $skey - * @param string $method + * @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method * @param array> $args * @return array{string,list} */ function signed_headers($skey, $method, $args) { @@ -208,7 +208,7 @@ function signed_headers($skey, $method, $args) { /** @template T * @param string $skey - * @param string $method + * @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method * @param array> $args * @param callable(S3Result):T $finisher * @return S3Result */ diff --git a/lib/s3result.php b/lib/s3result.php index f4a59c0df..a224e37f0 100644 --- a/lib/s3result.php +++ b/lib/s3result.php @@ -9,7 +9,7 @@ abstract class S3Result { /** @var string * @readonly */ public $skey; - /** @var string + /** @var 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' * @readonly */ protected $method; /** @var string */ @@ -25,7 +25,7 @@ abstract class S3Result { private $finisher; /** @param string $skey - * @param string $method + * @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method * @param array $args * @param callable(S3Result):T $finisher */ function __construct(S3Client $s3, $skey, $method, $args, $finisher) { @@ -47,7 +47,7 @@ function clear_result() { $this->response_headers = $this->user_data = []; } - /** @return string */ + /** @return 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' */ function method() { return $this->method; } @@ -103,7 +103,7 @@ class StreamS3Result extends S3Result { private $body; /** @param string $skey - * @param string $method + * @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method * @param array $args * @param callable(S3Result):T $finisher */ function __construct(S3Client $s3, $skey, $method, $args, $finisher) {