mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-29 08:26: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
|
||||
*
|
||||
* @throws \Exception
|
||||
|
@ -22,6 +22,9 @@ trait Pagination
|
||||
{
|
||||
abstract protected function httpGet(string $path, array $parameters = [], array $requestHeaders = []): ResponseInterface;
|
||||
|
||||
/**
|
||||
* @phpstan-param class-string $className
|
||||
*/
|
||||
abstract protected function hydrateResponse(ResponseInterface $response, string $className);
|
||||
|
||||
public function nextPage(PagingProvider $response): ?PagingProvider
|
||||
@ -44,6 +47,9 @@ trait Pagination
|
||||
return $this->getPaginationUrl($response->getLastUrl(), get_class($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-param class-string $class
|
||||
*/
|
||||
private function getPaginationUrl(string $url, string $class): ?PagingProvider
|
||||
{
|
||||
Assert::stringNotEmpty($class);
|
||||
|
Loading…
Reference in New Issue
Block a user