public function setType($type) { if (!in_array($type, ['class', 'interface', 'trait'], TRUE)) { throw new Nette\InvalidArgumentException('Argument must be class|interface|trait.'); } $this->type = $type; return $this; }