-
-
Notifications
You must be signed in to change notification settings - Fork 146
Closed
Description
hello, if I try to edit a file, I have no way to keep a method and overwrite others, as there is "setMethods" which does a $methods = [].
I think there may be a setMethod() or overwriteMethod() that allows to add without deleting everything.
// copied from addMethod
public function setMethod(Method $method): static
{
$lower = strtolower($method->getName());
if (isset($this->methods[$lower])) {
throw new Nette\InvalidStateException("Cannot add method '$name', because it already exists.");
}
if (!$this->isInterface()) {
$method->setPublic();
}
return $this->methods[$lower] = $method;
}
This problem arose when doing a diff between the methods of a class.
I think it is important to have automatically generated files that can be edited by the programmer and the generator without losing data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels