| @@ 110-122 (lines=13) @@ | ||
| 107 | 'config' => (object) $config, |
|
| 108 | ); |
|
| 109 | ||
| 110 | if (!empty($events)) |
|
| 111 | { |
|
| 112 | // Check to ensure all events are in the allowed list |
|
| 113 | foreach ($events as $event) |
|
| 114 | { |
|
| 115 | if (!in_array($event, $this->hookEvents)) |
|
| 116 | { |
|
| 117 | throw new \RuntimeException('Your events array contains an unauthorized event.'); |
|
| 118 | } |
|
| 119 | } |
|
| 120 | ||
| 121 | $data['events'] = $events; |
|
| 122 | } |
|
| 123 | ||
| 124 | return $this->processResponse( |
|
| 125 | $this->client->post($this->fetchUrl($path), $data), |
|
| @@ 187-199 (lines=13) @@ | ||
| 184 | $data['active'] = (bool) $active; |
|
| 185 | } |
|
| 186 | ||
| 187 | if (!empty($events)) |
|
| 188 | { |
|
| 189 | // Check to ensure all events are in the allowed list |
|
| 190 | foreach ($events as $event) |
|
| 191 | { |
|
| 192 | if (!in_array($event, $this->hookEvents)) |
|
| 193 | { |
|
| 194 | throw new \RuntimeException('Your events array contains an unauthorized event.'); |
|
| 195 | } |
|
| 196 | } |
|
| 197 | ||
| 198 | $data['events'] = $events; |
|
| 199 | } |
|
| 200 | ||
| 201 | return $this->processResponse( |
|
| 202 | $this->client->post($this->fetchUrl($path), $data), |
|