| 1 | <?php |
||
| 7 | abstract class Event |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | protected $webhookData; |
||
| 13 | |||
| 14 | public function __construct(array $webhookData) |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Getter for all data. |
||
| 21 | * |
||
| 22 | * @return array |
||
| 23 | */ |
||
| 24 | public function all(): array |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Getter for the webhook data. |
||
| 31 | * |
||
| 32 | * @param string $key |
||
| 33 | * @return mixed |
||
| 34 | */ |
||
| 35 | public function __get(string $key) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Determine if an attribute exists on the webhook data. |
||
| 52 | * |
||
| 53 | * @param string $key |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | public function __isset($key) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Generates the event class name with the 'alert_name' attribute from |
||
| 63 | * the data and fires the event with the data. |
||
| 64 | * |
||
| 65 | * @param array $data |
||
| 66 | * @return void |
||
| 67 | */ |
||
| 68 | public static function fire(array $data) |
||
| 76 | } |
||
| 77 |