public function getMethod($name) { if ($this->hasMethod($name)) { return $this->methods[$name]; } throw new InvalidArgumentException(sprintf('Method %s does not exist in class %s', $name, $this->reflection->getName())); }