Skip to content

Commit

Permalink
Specify methods in types.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Nov 18, 2020
1 parent 4c15d72 commit f809c8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/curls3result.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string,string> $args
* @param callable(S3Result):T $finisher */
function __construct(S3Client $s3, $skey, $method, $args, $finisher) {
Expand Down
6 changes: 3 additions & 3 deletions lib/s3client.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function check_403() {
}
}

/** @param string $method
/** @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method
* @param string $url
* @param array<string,string> $hdr
* @return array{headers:list<string>,signature:string} */
Expand Down Expand Up @@ -183,7 +183,7 @@ function signature($method, $url, $hdr) {
}

/** @param string $skey
* @param string $method
* @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method
* @param array<string,string|array<string,string>> $args
* @return array{string,list<string>} */
function signed_headers($skey, $method, $args) {
Expand All @@ -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<string,string|array<string,string>> $args
* @param callable(S3Result):T $finisher
* @return S3Result<T> */
Expand Down
8 changes: 4 additions & 4 deletions lib/s3result.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -25,7 +25,7 @@ abstract class S3Result {
private $finisher;

/** @param string $skey
* @param string $method
* @param 'GET'|'POST'|'HEAD'|'PUT'|'DELETE' $method
* @param array<string,string> $args
* @param callable(S3Result):T $finisher */
function __construct(S3Client $s3, $skey, $method, $args, $finisher) {
Expand All @@ -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;
}
Expand Down Expand Up @@ -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<string,string> $args
* @param callable(S3Result):T $finisher */
function __construct(S3Client $s3, $skey, $method, $args, $finisher) {
Expand Down

0 comments on commit f809c8a

Please sign in to comment.