예제 #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;
 }