Ejemplo n.º 1
0
 /**
  * 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(']');
 }
Ejemplo n.º 3
0
 /**
  * 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));
 }
Ejemplo n.º 4
0
 /**
  * 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);
 }
Ejemplo n.º 5
0
 /**
  * 移除观察者
  * @param \SplObserver $observer
  */
 public function detach(\SplObserver $observer)
 {
     if ($this->_observers == null) {
         return;
     }
     $this->_observers->detach($observer);
 }
Ejemplo n.º 6
0
 /**
  * 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;
     }
 }
Ejemplo n.º 7
0
 /**
  * 移除监听
  * @param ListenerInterface $listener
  */
 function detach(ListenerInterface $listener)
 {
     if ($this->storage->contains($listener)) {
         $this->storage->detach($listener);
         $this->refreshQueue();
     }
 }
Ejemplo n.º 8
0
 /**
  * {@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;
 }
Ejemplo n.º 10
0
 /**
  * @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);
 }
Ejemplo n.º 12
0
 /**
  * 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());
 }
Ejemplo n.º 13
0
 /**
  * {@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;
 }
Ejemplo n.º 15
0
 public function stopVisiting($object)
 {
     $this->visitingSet->detach($object);
     $poppedObject = $this->visitingStack->pop();
     if ($object !== $poppedObject) {
         throw new RuntimeException('Context visitingStack not working well');
     }
 }
Ejemplo n.º 16
0
 /** @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);
     }
 }
Ejemplo n.º 19
0
 /**
  * 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);
     }
 }
Ejemplo n.º 21
0
 /**
  * @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;
 }
Ejemplo n.º 22
0
 /**
  * @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;
 }
Ejemplo n.º 23
0
 /**
  * 删除一个监听器
  * @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;
 }
Ejemplo n.º 24
0
 /**
  * @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);
     }
 }
Ejemplo n.º 25
0
 /**
  * @param \Hynage\ORM\Entity $entity
  * @return \Hynage\ORM\EntityManager
  */
 public function removeEntity(Entity $entity)
 {
     if ($this->hasEntity($entity)) {
         $this->entitiesPool->detach($entity);
     }
     return $this;
 }
Ejemplo n.º 26
0
 /**
  * Saves any deferred cache items.
  *
  * @return mixed
  */
 public function commit()
 {
     foreach ($this->deferred as $item) {
         $this->deferred->detach($item);
         $item->save();
     }
 }
Ejemplo n.º 27
0
 /**
  * @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);
 }
Ejemplo n.º 29
0
 /**
  * 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;
 }
Ejemplo n.º 30
0
 public function removeElement(ElementInterface $e)
 {
     if ($this->_elements->contains($e)) {
         $this->_elements->detach($e);
     }
     return $this;
 }