| | |
| | | return $this->config; |
| | | } |
| | | |
| | | function getVersion() { |
| | | $response = $this->getApi()->get('/version'); |
| | | return $response['version']; |
| | | } |
| | | |
| | | function getCurrentEvent() { |
| | | if ($this->event === NULL) { |
| | | try { |
| | |
| | | throw new \RuntimeException('Failed to process event - event not found'); |
| | | } |
| | | |
| | | if (!is_int($event['entityId'])) { |
| | | if (!ctype_digit($event['entityId'])) { |
| | | throw new \RuntimeException('Failed to process event - invalid entity ID'); |
| | | } |
| | | |
| | | $this->event = $data; |
| | | } catch (\Exception $e) { |
| | | $this->event = $event; |
| | | } catch (\Throwable $e) { |
| | | $this->event = $e; |
| | | } |
| | | } |
| | | |
| | | if ($this->event instanceof \Exception) { |
| | | if ($this->event instanceof \Throwable) { |
| | | throw $this->event; |
| | | } |
| | | |