@@ -401,7 +401,7 @@ |
||
| 401 | 401 | /** |
| 402 | 402 | * Attempts to create a slack\Attachment instance based on the $attachment data given. |
| 403 | 403 | * |
| 404 | - * @param mixed $attachment |
|
| 404 | + * @param callable $attachment |
|
| 405 | 405 | * @return mixed Either an instantiated slack\Attachment, or a passthrough of the input data. |
| 406 | 406 | */ |
| 407 | 407 | protected function resolveAttachment($attachment) |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | $this->setIcon($attributes['icon']); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - foreach($attributes['attachments'] as $attachment) { |
|
| 107 | + foreach ($attributes['attachments'] as $attachment) { |
|
| 108 | 108 | $this->attach($attachment); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | $message['endpoint'] = $message['endpoint'] ?? $this->endpoint; |
| 148 | 148 | $message['username'] = $message['username'] ?? $this->username; |
| 149 | 149 | $message['parse'] = $message['parse'] ?? $this->parse; |
| 150 | - $message['link_names'] = $this->linkNames ? 1 : 0; |
|
| 150 | + $message['link_names'] = $this->linkNames ? 1 : 0; |
|
| 151 | 151 | $message['unfurl_links'] = $this->unfurlLinks; |
| 152 | 152 | $message['unfurl_media'] = $this->unfurlMedia; |
| 153 | 153 | $message['mrkdwn'] = $this->allowMarkdown; |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | 'api', $this->key |
| 74 | 74 | ], |
| 75 | 75 | 'multipart' => [ |
| 76 | - ['name' => 'to', 'contents' => implode(',', $recipients)], |
|
| 76 | + ['name' => 'to', 'contents' => implode(',', $recipients)], |
|
| 77 | 77 | ['name' => 'message', 'contents' => $message->toString(), 'filename' => 'message.mime'], |
| 78 | 78 | ] |
| 79 | 79 | ]); |
@@ -52,10 +52,10 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | protected function getMimeEntityString(\Swift_Mime_MimeEntity $entity) : string |
| 54 | 54 | { |
| 55 | - $result = (string) $entity->getHeaders() . PHP_EOL . $entity->getBody(); |
|
| 55 | + $result = (string) $entity->getHeaders().PHP_EOL.$entity->getBody(); |
|
| 56 | 56 | |
| 57 | 57 | foreach ($entity->getChildren() as $child) { |
| 58 | - $result .= PHP_EOL . PHP_EOL . $this->getMimeEntityString($child); |
|
| 58 | + $result .= PHP_EOL.PHP_EOL.$this->getMimeEntityString($child); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | return $result; |
@@ -158,7 +158,7 @@ |
||
| 158 | 158 | /** |
| 159 | 159 | * Converts an array of e-mail addresses into a string compliant with Postmark's API's format. |
| 160 | 160 | * |
| 161 | - * @param array $emails The e-mail addresses to convert. |
|
| 161 | + * @param string[] $emails The e-mail addresses to convert. |
|
| 162 | 162 | * @return string |
| 163 | 163 | */ |
| 164 | 164 | protected function emailsToString(array $emails) : string |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function send(\Swift_Mime_Message $message, &$failedRecipients = null) |
| 48 | 48 | { |
| 49 | - $this->client->request('POST','https://api.postmarkapp.com/email', [ |
|
| 49 | + $this->client->request('POST', 'https://api.postmarkapp.com/email', [ |
|
| 50 | 50 | 'headers' => [ |
| 51 | 51 | 'X-Postmark-Server-Token' => $this->key |
| 52 | 52 | ], |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | // Special treatment for the 'X-PM-Tag' header if it's available, which we'll pass into the payload |
| 104 | 104 | // directly. |
| 105 | - if ($fieldName === 'X-PM-Tag'){ |
|
| 105 | + if ($fieldName === 'X-PM-Tag') { |
|
| 106 | 106 | $payload["Tag"] = $header->getValue(); |
| 107 | 107 | } else { |
| 108 | 108 | $payload['Headers'][] = [ |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $addresses = []; |
| 167 | 167 | |
| 168 | 168 | foreach ($emails as $email => $name) { |
| 169 | - $addresses[] = $name ? '"' . str_replace('"', '\\"', $name) . "\" <{$email}>" : $email; |
|
| 169 | + $addresses[] = $name ? '"'.str_replace('"', '\\"', $name)."\" <{$email}>" : $email; |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | return implode(',', $addresses); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * Parses the first and only the first address from the given array of e-mail addresses into a structure |
| 153 | 153 | * understood by Sendgrid's API. |
| 154 | 154 | * |
| 155 | - * @param array $addresses The e-mail addresses to parse. |
|
| 155 | + * @param string[] $addresses The e-mail addresses to parse. |
|
| 156 | 156 | * @return array |
| 157 | 157 | */ |
| 158 | 158 | protected function processFirstAddress(array $addresses) : array |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | /** |
| 173 | 173 | * Parses the given array of e-mail addresses into a structure understood by Sendgrid's API. |
| 174 | 174 | * |
| 175 | - * @param array $addresses The e-mail addresses to parse. |
|
| 175 | + * @param string[] $addresses The e-mail addresses to parse. |
|
| 176 | 176 | * @return array |
| 177 | 177 | */ |
| 178 | 178 | protected function processAllAddresses(array $addresses) : array |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function register() |
| 23 | 23 | { |
| 24 | - $this->app->singleton(TransportManager::class, function (Application $app) { |
|
| 24 | + $this->app->singleton(TransportManager::class, function(Application $app) { |
|
| 25 | 25 | return new TransportManager($app); |
| 26 | 26 | }); |
| 27 | 27 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | protected function registerMailer() |
| 39 | 39 | { |
| 40 | - $this->app->singleton('mailer', function (Application $app) { |
|
| 40 | + $this->app->singleton('mailer', function(Application $app) { |
|
| 41 | 41 | |
| 42 | 42 | $mailer = new transports\mail\Mailer($app->make('mailer.transport'), $app->make('view')); |
| 43 | 43 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | // We are going to need to instantiate the Mailer with a proper Driver. |
| 62 | 62 | // @todo Drop the DriverManager in favour of handling the logic in this very Service Provider itself? |
| 63 | - $this->app->bind('mailer.transport', $this->app->share(function (Application $app) { |
|
| 63 | + $this->app->bind('mailer.transport', $this->app->share(function(Application $app) { |
|
| 64 | 64 | return (new transports\mail\DriverManager($app))->driver(); |
| 65 | 65 | })); |
| 66 | 66 | } |