Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function add(EnumInterface $enum)
 {
     if ($this->has($enum->getName())) {
         throw new DuplicatedEnumException($enum->getName());
     }
     $this->enums[$enum->getName()] = $enum;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function add(EnumInterface $enum)
 {
     if ($this->has($enum->getName())) {
         throw DuplicatedEnumException::alreadyRegistered($enum->getName());
     }
     $this->enums[$enum->getName()] = $enum;
 }