mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-25 22:36:06 +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
|
||||
{
|
||||
/**
|
||||
* @phpstan-param class-string $class
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function hydrate(ResponseInterface $response, string $class)
|
||||
@ -41,7 +43,7 @@ final class ModelHydrator implements Hydrator
|
||||
}
|
||||
|
||||
if (is_subclass_of($class, ApiResponse::class)) {
|
||||
$object = call_user_func($class.'::create', $data);
|
||||
$object = call_user_func([$class, 'create'], $data);
|
||||
} else {
|
||||
$object = new $class($data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user