public function addBeforeHook($hook) { if (!isset($this->options['before'])) { $this->options['before'] = []; } $this->options['before'][] = $hook; }