public function setMethods(array $methods)
{
$this->methods = [];
foreach ($methods as $v) {
if (!$v instanceof Method) {
throw new Nette\InvalidArgumentException('Argument must be Nette\\PhpGenerator\\Method[].');
}
$this->methods[$v->getName()] = $v->setNamespace($this->namespace);
}
return $this;
}