protected function getHook($name) { if (!isset($this->hooks[$name])) { throw new \InvalidArgumentException("Hook with name {$name} is not defined"); } return $this->hooks[$name]; }