> */ public $events; /** * @var string|null */ public $error; /** * @param bool $ok * @param array> $events * @param string|null $error */ public function __construct( $ok, $events = array(), $error = null ) { $this->ok = $ok; $this->events = $events; $this->error = $error; } /** * Serialize result to array for API responses. * * @return array */ public function toArray(): array { return array( 'ok' => $this->ok, 'events' => $this->events, 'error' => $this->error, ); } }