ResponseException::fromMissingData( string $apiName, string $fieldName ): self

In this article

Creates a ResponseException for missing expected data.

Parameters

$apiNamestringrequired
The name of the API/provider.
$fieldNamestringrequired
The field that was expected but missing.

Return

self

Source

public static function fromMissingData(string $apiName, string $fieldName): self
{
    $message = sprintf('Unexpected %s API response: Missing the "%s" key.', $apiName, $fieldName);
    return new self($message);
}

Changelog

VersionDescription
0.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.