public function register(BadgeEvaluatorInterface $evaluator) { $id = $evaluator->getId(); if (!array_key_exists($id, $this->evaluators)) { $this->evaluators[$evaluator->getId()] = $evaluator; } return $this; }
/** * * @return array */ public function registerBadges(BadgeEvaluatorInterface $evaluator) { $name = $evaluator->getName(); if (!array_key_exists($name, $this->badges)) { $this->badges[$name] = $evaluator->getAvailableBadges(); } else { throw new BadgesNameCollisionException("There is another bundle using the '{$name}' namespace."); } return $this; }