/** * Removes the specified validator. * * @param \TYPO3\FLOW3\Validation\Validator\ValidatorInterface $validator The validator to remove * @throws \TYPO3\FLOW3\Validation\Exception\NoSuchValidatorException * @api */ public function removeValidator(\TYPO3\FLOW3\Validation\Validator\ValidatorInterface $validator) { if (!$this->validators->contains($validator)) { throw new \TYPO3\FLOW3\Validation\Exception\NoSuchValidatorException('Cannot remove validator because its not in the conjunction.', 1207020177); } $this->validators->detach($validator); }
/** * @param ConnectionInterface $connection */ public function remove(ConnectionInterface $connection) { Debug::line(__CLASS__ . ': Remove ['); $this->storage->detach($connection); Debug::line('-- WebSocket connection removed'); Debug::line(']'); }
/** * Handle process on close transport * * @param \React\Socket\Connection $conn */ public function handleClose(Connection $conn) { Logger::debug($this, "Raw socket closed " . $conn->getRemoteAddress()); $session = $this->sessions[$conn]; $this->sessions->detach($conn); $this->router->getEventDispatcher()->dispatch('connection_close', new ConnectionCloseEvent($session)); }
/** * Removes the given comparison * * @param PropertyComparisonInterface $comparison * @throws Exception\InvalidComparisonException if the given comparison is not in the list * @return $this */ public function removeComparison($comparison) { if (!$this->comparisons->contains($comparison)) { throw new InvalidComparisonException('Can not remove given comparison because it is not in the list', 1409600320); } $this->comparisons->detach($comparison); }
/** * 移除观察者 * @param \SplObserver $observer */ public function detach(\SplObserver $observer) { if ($this->_observers == null) { return; } $this->_observers->detach($observer); }
/** * Remove the given log message handler if it is registered. * * @param LogHandler $handler */ public function removeHandler(LogHandler $handler) { if ($this->handlers->contains($handler)) { $this->handlers->detach($handler); $this->enabled = $this->handlers->count() ? true : false; } }
/** * 移除监听 * @param ListenerInterface $listener */ function detach(ListenerInterface $listener) { if ($this->storage->contains($listener)) { $this->storage->detach($listener); $this->refreshQueue(); } }
/** * {@inheritdoc} */ public function remove(TokenInterface $token) { if ($this->has($token)) { $this->pool->detach($token); return true; } return false; }
/** * @param MailboxService $mailbox * * @return bool */ public function detach(MailboxService $mailbox) { if ($this->contains($mailbox) === true) { $this->mailboxes->detach($mailbox); return true; } return false; }
/** * @param string $name * @throws ConnectionException */ public function removeConnection($name) { if (false !== ($obj = $this->findByName($name))) { $this->connections->detach($obj); } else { throw ConnectionException::NoConnectionDefinedByName($name); } }
/** * Runs the close() method of a backend and removes the backend * from the logger. * * @param Backend\BackendInterface $backend The backend to remove * @return void * @throws NoSuchBackendException if the given backend is unknown to this logger * @api */ public function removeBackend(Backend\BackendInterface $backend) { if (!$this->backends->contains($backend)) { throw new NoSuchBackendException('Backend is unknown to this logger.', 1229430381); } $backend->close(); $this->backends->detach($backend); }
/** * Detach a autoloadiable * * @param \Attw\Autoloader\AutoloadableInterface */ public function detach(AutoloadableInterface $autoloadable) { if (!$this->autoloadables->contains($autoloadable)) { throw new \Exception('The autoload hasn\'t been duplicated'); } $this->autoloadables->detach($autoloadable); spl_autoload_unregister($autoloadable->getCallable()); }
/** * {@inheritdoc} */ public function vertices() { $set = $this->getTraversableSplos($this->vertices); foreach ($set as $vertex) { (yield $vertex); } $this->walking->detach($set); }
/** * {@inheritdoc} */ public function remove(ItemInterface $item) { if ($this->has($item)) { $this->children->detach($item); $item->setParent(null); } return $this; }
public function stopVisiting($object) { $this->visitingSet->detach($object); $poppedObject = $this->visitingStack->pop(); if ($object !== $poppedObject) { throw new RuntimeException('Context visitingStack not working well'); } }
/** @inheritdoc */ public function onClose(ConnectionInterface $conn) { /** @var Session $session */ $session = $this->sessions[$conn]; $this->sessions->detach($conn); $this->router->getEventDispatcher()->dispatch('connection_close', new ConnectionCloseEvent($session)); unset($this->sessions[$conn]); Logger::info($this, "Ratchet has closed"); }
protected function shouldShutDownMessenger(Messenger $messenger) { if ($this->callQueue->count() == 0 && $this->pool->count() > $this->options['min_size']) { unset($this->coreMessengerMapping[spl_object_hash($messenger)]); $this->pool->detach($messenger); $messenger->softTerminate(); return; } $this->readyPool->enqueue($messenger); }
/** * {@inheritdoc} */ public function finish(RequestInterface $request, ResponseInterface $response) { if ($this->isTerminableKernel) { list($sfRequest, $sfResponse) = $this->requestMapping->offsetGet($request); $this->requestMapping->detach($request); $kernel = $this->kernel; /* @var $kernel TerminableInterface */ $kernel->terminate($sfRequest, $sfResponse); } }
/** * Unregister an AutoLoadable Object * * @param Next\Loader\AutoLoader\AutoLoadable $autoloader * The AutoLoader Object to be registered * * @return Next\AutoLoader * AutoLoader Instance (Fluent Interface) * * @throws Next\LoaderException * Trying to unregister a non registered AutoLoadable Object */ public function unregisterAutoLoader(AutoLoadable $autoloader) { if (!$this->autoloaders->contains($autoloader)) { require_once 'LoaderException.php'; throw LoaderException::unknown(); } $this->autoloaders->detach($autoloader); spl_autoload_unregister($autoloader->call()); return $this; }
/** * @param object $object * @throws IllegalObjectTypeException */ public function add($object) { $this->persistenceManager->whitelistObject($object); if ($this->removedResources->contains($object)) { $this->removedResources->detach($object); } if (!$this->addedResources->contains($object)) { $this->addedResources->attach($object); parent::add($object); } }
/** * @param CommandInterface $listener * @return void */ public function detach($listener) { $meta = $this->commands[$listener]; $event = $meta->event; $listeners = new \SplPriorityQueue(); foreach ($this->listeners[$event] as $cmd) { if ($cmd !== $listener) { $listeners->insert($cmd, $meta->priority); } } $this->commands->detach($listener); $this->listeners[$event] = $listeners; }
/** * @param FieldInterface|string $childName * @return FormInterface|FALSE */ public function remove($childName) { foreach ($this->children as $child) { /** @var FieldInterface $child */ $isMatchingInstance = TRUE === $childName instanceof FormInterface && $childName->getName() === $child->getName(); $isMatchingName = $childName === $child->getName(); if (TRUE === $isMatchingName || TRUE === $isMatchingInstance) { $this->children->detach($child); $this->children->rewind(); $child->setParent(NULL); return $child; } } return FALSE; }
/** * 删除一个监听器 * @param $listener * @return $this */ public function remove($listener) { if ($this->has($listener)) { $this->store->detach($listener); $this->store->rewind(); $queue = new \SplPriorityQueue(); foreach ($this->store as $listener) { // 优先级 $priority = $this->store->getInfo(); $queue->insert($listener, $priority); } $this->queue = $queue; } return $this; }
/** * @param mixed $link */ private function free($link) { $query = $this->controller->getQuery($this->driver, $link); if ($query) { try { $this->driver->query($link, $query->getExpression()); $this->active->attach($link, $query); } catch (\Exception $err) { $this->active->detach($link); $query->reject($err); } } else { $this->active->detach($link); } }
/** * @param \Hynage\ORM\Entity $entity * @return \Hynage\ORM\EntityManager */ public function removeEntity(Entity $entity) { if ($this->hasEntity($entity)) { $this->entitiesPool->detach($entity); } return $this; }
/** * Saves any deferred cache items. * * @return mixed */ public function commit() { foreach ($this->deferred as $item) { $this->deferred->detach($item); $item->save(); } }
/** * @param object $object * @throws Exception\WrongArgument */ public function detach($object) { if (!$object instanceof SMS) { throw new Exception\WrongArgument(); } parent::detach($object); }
/** * @param \SplObserver * @return void * @throws \UnderflowException */ public function detach(SplObserver $observer) { if (!$this->observers->contains($observer)) { throw new UnderflowException(sprintf('Given observer is not on the observers list: "%s"', get_class($observer))); } $this->observers->detach($observer); }
/** * Destroys a conditional proxy state. * * This should be called from either the object implementing the conditional * proxy <code>_endif()</code> method or the <code>_endif()</code> method * within the conditional proxy handler object. * * @param ConditionalProxy $object A conditional proxy object. * * @return ConditionalProxy The original conditional proxy object. */ public static function destroy($object) { self::verifyObjectType($object); self::checkExistsInStore($object); self::$store->detach($object); return $object; }
public function removeElement(ElementInterface $e) { if ($this->_elements->contains($e)) { $this->_elements->detach($e); } return $this; }