/** * {@inheritDoc} */ public function addListener($eventName, callable $callable) { if (!$this->listeners->containsKey($eventName)) { $this->listeners->add(new Pair($eventName, new Vector())); } $this->listeners->get($eventName)->add($callable); }
/** * @param MapInterface $data * * @return FeatureInterface */ public function deserialize(MapInterface $data) { /** @var MapInterface $conditions */ $conditions = $data->get('conditions'); if (!$conditions instanceof MapInterface) { throw new \RuntimeException('Key "conditions" should be an MapInterface.'); } $toggle = new Feature($data->get('name'), $this->deserializeConditions($conditions), $data->containsKey('strategy') ? $this->deserializeStrategy($data->get('strategy')) : ToggleStrategy::AFFIRMATIVE); if ($data->containsKey('status')) { $this->deserializeStatus($toggle, $data->get('status')); } return $toggle; }
public function has(AggregateIdInterface $id, $version) { return $this->snapshots->containsKey((string) $id); }
public function has($name) { return $this->features->containsKey($name); }