Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3937289
D681.id1710.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D681.id1710.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D681: Typehint $payload parameter in MailgunMessage methods
Attached
Detach File
Event Timeline
Log In to Comment