mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-16 21:13:12 +03:00
Fix PHPStan error reported for ModelHydrator::hydrate.
Line 45: Parameter #1 $callback of function call_user_func expects callable(): mixed, non-empty-string given.
This commit is contained in:
parent
4ec42cdaf0
commit
dd93eee967
@ -23,6 +23,8 @@ use Psr\Http\Message\ResponseInterface;
|
|||||||
final class ModelHydrator implements Hydrator
|
final class ModelHydrator implements Hydrator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* @phpstan-param class-string $class
|
||||||
|
*
|
||||||
* @return ResponseInterface
|
* @return ResponseInterface
|
||||||
*/
|
*/
|
||||||
public function hydrate(ResponseInterface $response, string $class)
|
public function hydrate(ResponseInterface $response, string $class)
|
||||||
@ -41,7 +43,7 @@ final class ModelHydrator implements Hydrator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_subclass_of($class, ApiResponse::class)) {
|
if (is_subclass_of($class, ApiResponse::class)) {
|
||||||
$object = call_user_func($class.'::create', $data);
|
$object = call_user_func([$class, 'create'], $data);
|
||||||
} else {
|
} else {
|
||||||
$object = new $class($data);
|
$object = new $class($data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user