public function getMethod($nameOrMethod)
{
if ($nameOrMethod instanceof PhpMethod) {
$nameOrMethod = $nameOrMethod->getName();
}
if (!$this->methods->has($nameOrMethod)) {
throw new \InvalidArgumentException(sprintf('The method "%s" does not exist.', $nameOrMethod));
}
return $this->methods->get($nameOrMethod);
}