mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-25 22:36:06 +03:00
Tighten the types of functions that call Hydrator::hydrate.
This commit is contained in:
parent
fdb25218a6
commit
fe6a21e1d2
@ -59,6 +59,8 @@ abstract class HttpApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @phpstan-param class-string $class
|
||||||
|
*
|
||||||
* @return mixed|ResponseInterface
|
* @return mixed|ResponseInterface
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
|
@ -22,6 +22,9 @@ trait Pagination
|
|||||||
{
|
{
|
||||||
abstract protected function httpGet(string $path, array $parameters = [], array $requestHeaders = []): ResponseInterface;
|
abstract protected function httpGet(string $path, array $parameters = [], array $requestHeaders = []): ResponseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @phpstan-param class-string $className
|
||||||
|
*/
|
||||||
abstract protected function hydrateResponse(ResponseInterface $response, string $className);
|
abstract protected function hydrateResponse(ResponseInterface $response, string $className);
|
||||||
|
|
||||||
public function nextPage(PagingProvider $response): ?PagingProvider
|
public function nextPage(PagingProvider $response): ?PagingProvider
|
||||||
@ -44,6 +47,9 @@ trait Pagination
|
|||||||
return $this->getPaginationUrl($response->getLastUrl(), get_class($response));
|
return $this->getPaginationUrl($response->getLastUrl(), get_class($response));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @phpstan-param class-string $class
|
||||||
|
*/
|
||||||
private function getPaginationUrl(string $url, string $class): ?PagingProvider
|
private function getPaginationUrl(string $url, string $class): ?PagingProvider
|
||||||
{
|
{
|
||||||
Assert::stringNotEmpty($class);
|
Assert::stringNotEmpty($class);
|
||||||
|
Loading…
Reference in New Issue
Block a user