/** * Get the restriction at index * * @static * * @param mixed $index The index of the register. * * @return Falcraft\Data\Types\Restrictions The restrictions registered at index * * @throws \RangeException if the restriction index is not registered. * */ public static function getRestriction($index) { if (self::$registry === null) { self::$registry = new Map(); self::initRegistry(); } if (!self::isRestrictionRegistered($index)) { throw new TypesExceptions\RangeException('TaggedUnionFactory->getRestriction: Restriction ' . $index . ' Not Registered'); } else { return self::$registry->find($index); } }
/** * Remove a handler form the queue of a particular filter * * NOTE: You can only remove a handler from a specific filter, not * conduit-wise * * @param Falcraft\Event\Resource\Filter $filter The given filter * @param Falcraft\Event\Resource\Handler $handler The handler to remove * */ public function removeHandler(EventResource\FilterInterface $filter, EventResource\Handler $handler) { if (in_array($filter, $this->conduit->getKeys())) { $this->conduit->find($filter)->remove($handler); } }