1010use AsyncAws \Core \Credentials \ChainProvider ;
1111use AsyncAws \Core \Credentials \CredentialProvider ;
1212use AsyncAws \Core \EndpointDiscovery \EndpointCache ;
13+ use AsyncAws \Core \EndpointDiscovery \EndpointInterface ;
1314use AsyncAws \Core \Exception \InvalidArgument ;
1415use AsyncAws \Core \Exception \LogicException ;
1516use AsyncAws \Core \Exception \RuntimeException ;
@@ -47,7 +48,7 @@ abstract class AbstractApi
4748 private $ credentialProvider ;
4849
4950 /**
50- * @var Signer[]
51+ * @var array<string, Signer>
5152 */
5253 private $ signers ;
5354
@@ -67,7 +68,7 @@ abstract class AbstractApi
6768 private $ endpointCache ;
6869
6970 /**
70- * @param Configuration|array $configuration
71+ * @param Configuration|array<Configuration::OPTION_*, string|null> $configuration
7172 */
7273 public function __construct ($ configuration = [], ?CredentialProvider $ credentialProvider = null , ?HttpClientInterface $ httpClient = null , ?LoggerInterface $ logger = null )
7374 {
@@ -151,7 +152,7 @@ final protected function getResponse(Request $request, ?RequestContext $context
151152 $ request ->setHeader ('content-length ' , (string ) $ length );
152153 }
153154
154- // Some servers (like testing Docker Images) does not supports `Transfer-Encoding: chunked` requests.
155+ // Some servers (like testing Docker Images) does not support `Transfer-Encoding: chunked` requests.
155156 // The body is converted into string to prevent curl using `Transfer-Encoding: chunked` unless it really has to.
156157 if (($ requestBody = $ request ->getBody ()) instanceof StringStream) {
157158 $ requestBody = $ requestBody ->stringify ();
@@ -178,7 +179,7 @@ final protected function getResponse(Request $request, ?RequestContext $context
178179 }
179180
180181 /**
181- * @return callable[]
182+ * @return array<string, callable(string, string): Signer>
182183 */
183184 protected function getSignerFactories (): array
184185 {
@@ -229,9 +230,9 @@ protected function getEndpointMetadata(?string $region): array
229230 /**
230231 * Build the endpoint full uri.
231232 *
232- * @param string $uri or path
233- * @param array $query parameters that should go in the query string
234- * @param ?string $region region provided by the user in the `@region` parameter of the Input
233+ * @param string $uri or path
234+ * @param array<string, string> $query parameters that should go in the query string
235+ * @param ?string $region region provided by the user in the `@region` parameter of the Input
235236 */
236237 protected function getEndpoint (string $ uri , array $ query , ?string $ region ): string
237238 {
@@ -263,11 +264,19 @@ protected function getEndpoint(string $uri, array $query, ?string $region): stri
263264 return $ endpoint . (false === strpos ($ endpoint , '? ' ) ? '? ' : '& ' ) . http_build_query ($ query , '' , '& ' , \PHP_QUERY_RFC3986 );
264265 }
265266
267+ /**
268+ * @return EndpointInterface[]
269+ */
266270 protected function discoverEndpoints (?string $ region ): array
267271 {
268272 throw new LogicException (sprintf ('The Client "%s" must implement the "%s" method. ' , \get_class ($ this ), 'discoverEndpoints ' ));
269273 }
270274
275+ /**
276+ * @param array<string, string> $query
277+ *
278+ * @return string
279+ */
271280 private function getDiscoveredEndpoint (string $ uri , array $ query , ?string $ region , bool $ usesEndpointDiscovery , bool $ requiresEndpointDiscovery )
272281 {
273282 if (!$ this ->configuration ->isDefault ('endpoint ' )) {
@@ -314,7 +323,7 @@ private function getDiscoveredEndpoint(string $uri, array $query, ?string $regio
314323 /**
315324 * @param ?string $region region provided by the user in the `@region` parameter of the Input
316325 */
317- private function getSigner (?string $ region )
326+ private function getSigner (?string $ region ): Signer
318327 {
319328 /** @var string $region */
320329 $ region = $ region ?? ($ this ->configuration ->isDefault ('region ' ) ? null : $ this ->configuration ->get ('region ' ));
0 commit comments