/** * {@inheritdoc} */ public function add(EnumInterface $enum) { if ($this->has($enum->getName())) { throw new DuplicatedEnumException($enum->getName()); } $this->enums[$enum->getName()] = $enum; }
/** * {@inheritdoc} */ public function add(EnumInterface $enum) { if ($this->has($enum->getName())) { throw DuplicatedEnumException::alreadyRegistered($enum->getName()); } $this->enums[$enum->getName()] = $enum; }