class ApiClient mixin TResource>

Traits

Properties

protected TResource> $resource
protected list<callable|object|string> $requestMiddleware
protected list<callable|object|string> $responseMiddleware

Methods

mixed
forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

static never
throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

createPendingRequest()

Create a pending API request.

newPendingRequest()

Create a new pending API request instance.

void
configurePendingRequest(PendingRequest $request)

Configure a pending API request.

mixed
__call(string $method, array $parameters)

Dynamically pass method calls to a pending API request.

Details

in ForwardsCalls at line 22
protected mixed forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ForwardsCalls at line 52
protected mixed forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ForwardsCalls at line 66
static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

Exceptions

BadMethodCallException

at line 37
PendingRequest createPendingRequest()

Create a pending API request.

Return Value

PendingRequest

at line 54
protected PendingRequest newPendingRequest()

Create a new pending API request instance.

Return Value

PendingRequest

at line 65
protected void configurePendingRequest(PendingRequest $request)

Configure a pending API request.

Parameters

PendingRequest $request

Return Value

void

at line 72
mixed __call(string $method, array $parameters)

Dynamically pass method calls to a pending API request.

Parameters

string $method
array $parameters

Return Value

mixed