72 public function addGenerator(
string $class,
string $name, \Closure $presetValidator,
bool $overwrite =
false) : void{
75 $name = strtolower($name);
76 if(!$overwrite && isset($this->list[$name])){
77 throw new \InvalidArgumentException(
"Alias \"$name\" is already assigned");
87 public function addAlias(
string $name,
string $alias) : void{
88 $name = strtolower($name);
89 $alias = strtolower($alias);
90 if(!isset($this->list[$name])){
91 throw new \InvalidArgumentException(
"Alias \"$name\" is not assigned");
93 if(isset($this->list[$alias])){
94 throw new \InvalidArgumentException(
"Alias \"$alias\" is already assigned");
96 $this->list[$alias] = $this->list[$name];