本文整理汇总了PHP中SplObjectStorage::detach方法的典型用法代码示例。如果您正苦于以下问题:PHP SplObjectStorage::detach方法的具体用法?PHP SplObjectStorage::detach怎么用?PHP SplObjectStorage::detach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SplObjectStorage
的用法示例。
在下文中一共展示了SplObjectStorage::detach方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeValidator
/**
* 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);
}
示例2: remove
/**
* @param ConnectionInterface $connection
*/
public function remove(ConnectionInterface $connection)
{
Debug::line(__CLASS__ . ': Remove [');
$this->storage->detach($connection);
Debug::line('-- WebSocket connection removed');
Debug::line(']');
}
示例3: handleClose
/**
* 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));
}
示例4: removeComparison
/**
* 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);
}
示例5: detach
/**
* 移除观察者
* @param \SplObserver $observer
*/
public function detach(\SplObserver $observer)
{
if ($this->_observers == null) {
return;
}
$this->_observers->detach($observer);
}
示例6: removeHandler
/**
* 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;
}
}
示例7: detach
/**
* 移除监听
* @param ListenerInterface $listener
*/
function detach(ListenerInterface $listener)
{
if ($this->storage->contains($listener)) {
$this->storage->detach($listener);
$this->refreshQueue();
}
}
示例8: remove
/**
* {@inheritdoc}
*/
public function remove(TokenInterface $token)
{
if ($this->has($token)) {
$this->pool->detach($token);
return true;
}
return false;
}
示例9: detach
/**
* @param MailboxService $mailbox
*
* @return bool
*/
public function detach(MailboxService $mailbox)
{
if ($this->contains($mailbox) === true) {
$this->mailboxes->detach($mailbox);
return true;
}
return false;
}
示例10: removeConnection
/**
* @param string $name
* @throws ConnectionException
*/
public function removeConnection($name)
{
if (false !== ($obj = $this->findByName($name))) {
$this->connections->detach($obj);
} else {
throw ConnectionException::NoConnectionDefinedByName($name);
}
}
示例11: removeBackend
/**
* 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);
}
示例12: detach
/**
* 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());
}
示例13: vertices
/**
* {@inheritdoc}
*/
public function vertices()
{
$set = $this->getTraversableSplos($this->vertices);
foreach ($set as $vertex) {
(yield $vertex);
}
$this->walking->detach($set);
}
示例14: remove
/**
* {@inheritdoc}
*/
public function remove(ItemInterface $item)
{
if ($this->has($item)) {
$this->children->detach($item);
$item->setParent(null);
}
return $this;
}
示例15: stopVisiting
public function stopVisiting($object)
{
$this->visitingSet->detach($object);
$poppedObject = $this->visitingStack->pop();
if ($object !== $poppedObject) {
throw new RuntimeException('Context visitingStack not working well');
}
}