1 | <?php |
||
10 | class PostmarkTransport extends Transport |
||
11 | { |
||
12 | /** |
||
13 | * Guzzle client instance. |
||
14 | * |
||
15 | * @var \GuzzleHttp\ClientInterface |
||
16 | */ |
||
17 | protected $client; |
||
18 | |||
19 | /** |
||
20 | * The Postmark API key. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $key; |
||
25 | |||
26 | /** |
||
27 | * The Postmark API end-point. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $url = 'https://api.postmarkapp.com/email'; |
||
32 | |||
33 | /** |
||
34 | * Create a new Postmark transport instance. |
||
35 | * |
||
36 | * @param \GuzzleHttp\ClientInterface $client |
||
37 | * @param string $key |
||
38 | * |
||
39 | * @return void |
||
40 | */ |
||
41 | 4 | public function __construct(ClientInterface $client, $key) |
|
46 | |||
47 | /** |
||
48 | * Send the given Message. |
||
49 | * |
||
50 | * Recipient/sender data will be retrieved from the Message API. |
||
51 | * The return value is the number of recipients who were accepted for delivery. |
||
52 | * |
||
53 | * @param Swift_Mime_SimpleMessage $message |
||
54 | * @param string[] $failedRecipients An array of failures by-reference |
||
55 | * |
||
56 | * @return int |
||
57 | */ |
||
58 | 1 | public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) |
|
73 | |||
74 | /** |
||
75 | * Get all attachments for the given message. |
||
76 | * |
||
77 | * @param \Swift_Mime_SimpleMessage $message |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | 2 | protected function getAttachments(Swift_Mime_SimpleMessage $message) |
|
101 | |||
102 | /** |
||
103 | * Format the contacts for the API request |
||
104 | * |
||
105 | * @param array $contacts |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | 3 | protected function getContacts($contacts) |
|
118 | |||
119 | /** |
||
120 | * Get the message ID from the response. |
||
121 | * |
||
122 | * @param \GuzzleHttp\Psr7\Response $response |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | 1 | protected function getMessageId($response) |
|
133 | |||
134 | /** |
||
135 | * Get the HTTP payload for sending the Postmark message. |
||
136 | * |
||
137 | * @param \Swift_Mime_SimpleMessage $message |
||
138 | * |
||
139 | * @return array |
||
140 | */ |
||
141 | 2 | protected function payload(Swift_Mime_SimpleMessage $message) |
|
170 | } |
||
171 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: