mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-29 16:36:07 +03:00
Tighten types for Hydrator and its subclasses to address issue caught by Psalm.
The issue caught by Psalm: Argument 2 of Mailgun\Hydrator\ModelHydrator::hydrate has the more specific type 'class-string', expecting 'string' as defined by Mailgun\Hydrator\Hydrator::hydrate
This commit is contained in:
parent
dd93eee967
commit
fdb25218a6
@ -22,6 +22,8 @@ use Psr\Http\Message\ResponseInterface;
|
|||||||
final class ArrayHydrator implements Hydrator
|
final class ArrayHydrator implements Hydrator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* @phpstan-param class-string $class
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function hydrate(ResponseInterface $response, string $class)
|
public function hydrate(ResponseInterface $response, string $class)
|
||||||
|
@ -20,6 +20,8 @@ use Psr\Http\Message\ResponseInterface;
|
|||||||
interface Hydrator
|
interface Hydrator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* @phpstan-param class-string $class
|
||||||
|
*
|
||||||
* @throws HydrationException
|
* @throws HydrationException
|
||||||
*/
|
*/
|
||||||
public function hydrate(ResponseInterface $response, string $class);
|
public function hydrate(ResponseInterface $response, string $class);
|
||||||
|
@ -21,6 +21,8 @@ use Psr\Http\Message\ResponseInterface;
|
|||||||
final class NoopHydrator implements Hydrator
|
final class NoopHydrator implements Hydrator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* @phpstan-param class-string $class
|
||||||
|
*
|
||||||
* @throws \LogicException
|
* @throws \LogicException
|
||||||
*/
|
*/
|
||||||
public function hydrate(ResponseInterface $response, string $class)
|
public function hydrate(ResponseInterface $response, string $class)
|
||||||
|
Loading…
Reference in New Issue
Block a user