@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | if (isset($values["link"]) && ($values["link"] !== NULL)) { |
| 97 | 97 | $values["message"] .= "\n"; |
| 98 | 98 | $values["message"] .= "<" . $values["link"]; |
| 99 | - if(isset($values["link_text"]) && ($values["link_text"] !== NULL)) { |
|
| 99 | + if (isset($values["link_text"]) && ($values["link_text"] !== NULL)) { |
|
| 100 | 100 | $values["message"] .= "|" . $values["link_text"]; |
| 101 | 101 | } |
| 102 | - $values["message"] .= ">" ; |
|
| 102 | + $values["message"] .= ">"; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // Set the parameters for the request |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | try { |
| 142 | 142 | $client = new \GuzzleHttp\Client(); |
| 143 | 143 | $json_response = $client->request('POST', $this->url, [ |
| 144 | - 'body' => json_encode( $params ) |
|
| 144 | + 'body' => json_encode($params) |
|
| 145 | 145 | ]); |
| 146 | 146 | } |
| 147 | - catch(RequestException $e) { |
|
| 148 | - throw new RuntimeException('The request to the webhook failed: '.$e->getMessage(), $e->getCode(), $e); |
|
| 147 | + catch (RequestException $e) { |
|
| 148 | + throw new RuntimeException('The request to the webhook failed: ' . $e->getMessage(), $e->getCode(), $e); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // We re-initialize the attachments to prevent any conflict with a future message. |
@@ -175,13 +175,13 @@ discard block |
||
| 175 | 175 | // Create an array with the valid values |
| 176 | 176 | $valid_values = explode(",", self::SLACK_VALID_ATTACHMENTS); |
| 177 | 177 | |
| 178 | - if(!in_array($key, $valid_values)) { |
|
| 178 | + if (!in_array($key, $valid_values)) { |
|
| 179 | 179 | unset($attachment[$key]); |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | // Check if a message has been defined |
| 184 | - if(!isset($attachment["fallback"], $attachment["fields"], $attachment["fields"]["title"])) { |
|
| 184 | + if (!isset($attachment["fallback"], $attachment["fields"], $attachment["fields"]["title"])) { |
|
| 185 | 185 | throw new InvalidArgumentException("Attachment fields are missing."); |
| 186 | 186 | } |
| 187 | 187 | } |
@@ -162,8 +162,7 @@ |
||
| 162 | 162 | * @param array $attachments |
| 163 | 163 | * @return Webhook |
| 164 | 164 | */ |
| 165 | - public function setAttachments($attachments) |
|
| 166 | - { |
|
| 165 | + public function setAttachments($attachments) { |
|
| 167 | 166 | if (!is_array($attachments)) { |
| 168 | 167 | throw new InvalidArgumentException('The attachments must be an array.'); |
| 169 | 168 | } |