Page MenuHomeDevCentral

D681.id1710.diff
No OneTemporary

D681.id1710.diff

diff --git a/src/MailgunMessage.php b/src/MailgunMessage.php
--- a/src/MailgunMessage.php
+++ b/src/MailgunMessage.php
@@ -5,6 +5,7 @@
use GuzzleHttp\ClientInterface;
use InvalidArgumentException;
+use stdClass;
class MailgunMessage {
@@ -53,10 +54,10 @@
* Initializes a new instance of the MailgunMessage object from a payload.
*
* @param \GuzzleHttp\Client $client HTTP client
- * @param object $payload The payload fired by MailGun routing API
+ * @param stdClass $payload The payload fired by MailGun routing API
* @param string $key The API key to use to fetch the message.
*/
- public static function loadFromEventPayload (ClientInterface $client, $payload, $key) {
+ public static function loadFromEventPayload (ClientInterface $client, stdClass $payload, $key) {
$url = self::extractUrlFromEventPayload($payload);
return new self($client, $url, $key);
}
@@ -119,10 +120,11 @@
/**
* Extracts the MailGun URL to retrieve a stored message.
*
+ * @param stdClass $payload The payload fired by MailGun routing API
* @return string
* @throw \InvalidArgumentException if payload doesn't contain URL where expected.
*/
- private static function extractUrlFromEventPayload ($payload) {
+ private static function extractUrlFromEventPayload (stdClass $payload) {
if (!isset($payload->storage->url)) {
throw new InvalidArgumentException("The payload should be an object with a storage.url property.");
}

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 17:05 (15 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2314030
Default Alt Text
D681.id1710.diff (1 KB)

Event Timeline