mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-29 08:26:06 +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
|
||||
{
|
||||
/**
|
||||
* @phpstan-param class-string $class
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function hydrate(ResponseInterface $response, string $class)
|
||||
|
@ -20,6 +20,8 @@ use Psr\Http\Message\ResponseInterface;
|
||||
interface Hydrator
|
||||
{
|
||||
/**
|
||||
* @phpstan-param class-string $class
|
||||
*
|
||||
* @throws HydrationException
|
||||
*/
|
||||
public function hydrate(ResponseInterface $response, string $class);
|
||||
|
@ -21,6 +21,8 @@ use Psr\Http\Message\ResponseInterface;
|
||||
final class NoopHydrator implements Hydrator
|
||||
{
|
||||
/**
|
||||
* @phpstan-param class-string $class
|
||||
*
|
||||
* @throws \LogicException
|
||||
*/
|
||||
public function hydrate(ResponseInterface $response, string $class)
|
||||
|
Loading…
Reference in New Issue
Block a user