\EasyWeChat\Kernel\TraitsResponseCastable

Trait ResponseCastable.

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
castResponseToType()
detectAndCastResponseToType()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

castResponseToType()

castResponseToType(\Psr\Http\Message\ResponseInterface  $response, string|null  $type = null) : array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string

Parameters

\Psr\Http\Message\ResponseInterface $response
string|null $type

Throws

\EasyWeChat\Kernel\Exceptions\InvalidConfigException

Returns

array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string

detectAndCastResponseToType()

detectAndCastResponseToType(mixed  $response, string|null  $type = null) : array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string

Parameters

mixed $response
string|null $type

Throws

\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
\EasyWeChat\Kernel\Exceptions\InvalidConfigException

Returns

array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string