Delete watch callback on a node, delete all callback when $callback is null
@param string $path
@param callable $callback
@return boolean|NULL
776267
public function cancelWatch($path, $callback = null)
	{
		if (isset($this->callback[$path])) {
			if (empty($callback)) {
				unset($this->callback[$path]);
				$this->zookeeper->get($path); //reset the callback
				return true;
			} else {
				$key = array_search($callback, $this->callback[$path]);
				if ($key !== false) {
					unset($this->callback[$path][$key]);
					return true;
				} else {
					return null;
				}
			}
		} else {
			return null;
		}
	}
1257879
public function put(string $path, callable $callback, int $priority = 0)
    {
        return $this->route('put', $path, $callback, $priority);
    }
1362194
public function all(string $path, callable $callback, int $priority = 0)
    {
        return $this->route('all', $path, $callback, $priority);
    }
633377
public function remove(callable $callback)
    {
        foreach (array_keys($this->storage) as $priority) {
            $indexes = array_keys($this->storage[$priority], $callback, true);
            foreach ($indexes as $index) {
                unset($this->storage[$priority][$index]);
                if (empty($this->storage[$priority])) {
                    unset($this->storage[$priority]);
                }
            }
        }
    }
423311
public function off(string $event = null, callable $callback = null): EventInterface
    {
        //if there is no event and not callable
        if (is_null($event) && is_null($callback)) {
            //it means that they want to remove everything
            $this->observers = [];
            return $this;
        }

        //if there are callbacks listening to
        //this and no callback was specified
        if (isset($this->observers[$event]) && is_null($callback)) {
            //it means that they want to remove
            //all callbacks listening to this event
            unset($this->observers[$event]);
            return $this;
        }

        //if there are callbacks listening
        //to this and we have a callback
        if (isset($this->observers[$event]) && is_callable($callback)) {
            return $this->removeObserversByEvent($event, $callback);
        }

        //if no event, but there is a callback
        if (is_null($event) && is_callable($callback)) {
            return $this->removeObserversByCallback($callback);
        }

        // @codeCoverageIgnoreStart
        return $this;
        // @codeCoverageIgnoreEnd
    }
1316100
public function prune(callable $callback): self
    {
        $index = 0;
        foreach ($this->items as $key => $value) {
            if ($callback($value, $key, $index++)) {
                $this->remove($key);
            }
        }

        return $this;
    }
348514
public function post( $path, callable $callback ) {
        $route = new Route( 'POST', $path, $callback );
        $this->_routes[] = $route;
        return $route;
    }
275243
protected function onDelete(callable $callback, $entityClass = null)
    {
        $this->checkIfInitialized();

        return $this->processEntities($this->uow->getScheduledEntityDeletions(), self::OPERATION_DELETE, $callback, $entityClass);
    }
1226816
public static function post($path, $callback)
    {
        self::instance()->addRoute('POST', $path, self::callback($callback));
    }
949511
public function delete( $path, callable $callback ) {
        $route = new Route( 'DELETE', $path, $callback );
        $this->_routes[] = $route;
        return $route;
    }
1224991
private function remove(string $selector, callable $callback = null): self {
        $nodes = $this->document()->find($selector);

        foreach ($nodes as $node) {
            if (is_null($callback) || $callback($node)) {
                $node->remove();
            }
        }

        return $this;
    }
981262
public function delete($path) {
		$this->connectIfNeeded();
		$this->handle->delete($path);
		$this->onFileDeleted(new Event(['sender' => $this, 'data' => $path]));
	}
649324
public function detach($event, $callback)
    {
        if (null !== $callback) {
            $oid = $this->hashCallable($callback);
            if (isset($this->callable_map[$event][$oid])) {
                $callback = $this->callable_map[$event][$oid];
                unset($this->callable_map[$event][$oid]);
            }
        } else {
            unset($this->callable_map[$event]);
        }
        return parent::detach($event, $callback);
    }
762647
public function delete($path, $parameters = null, $version = null, $etag = null)
        {
            return $this->api('DELETE', $path, $parameters, $version, $etag);
        }
857106
public function detach($event, $callback)
    {
        if ($this->hasEvent($event)) {
            $this->removeEventCallable($event, $callback);
        } elseif ('' === $event) {
            $this->events = []; // remove all events
        }
        return true;
    }
917296
public function processNode( &$nodes, $path, $callback = null )
	{
		// This is working variable to hold the 'current node'
		if ( isset( $pathNode ) ) unset( $pathNode );

		$pathsParts = explode( '/', $path );
		for ( $i = 0; $i < count( $pathsParts ); $i++ )
		{
			// Should do error checking here.  There's lots to go wrong.
			// Working down the hierarchy using the path components.
			$pathNode =& $nodes[ $pathsParts[ $i ] ];

			// Get the text for the node if not already retrieved
			if ( ! isset( $pathNode['text'] ) )
			{
				// $element_xsd = parse_url( $pathNode['label'], PHP_URL_PATH );
				// $key = "$element_xsd#{$pathNode['taxonomy_element']['id']}";

				$taxonomy = $this->getTaxonomyForXSD( $pathNode['label'] );
				$key = $pathNode['label'];

				$pathNode['text'] = $this->getTaxonomyDescriptionForIdWithDefaults(
					$key,
					isset( $pathNode['preferredLabel'] ) ? $pathNode['preferredLabel'] : null,
					$this->getDefaultLanguage()
				);

				if ( ! $pathNode['text'] )
				{
					$pathNode['text'] = $pathNode['label'];
				}
			}

			$nodes =& $pathNode['children'];
		}

		// $pathnode is now the node to which to add the values
		if ( ! $pathNode ) return false; // Something went wrong

		if ( ! empty( $callback ) )
			$callback( $pathNode );

		return true;
	}
244502
public function get(String $path, Callable $callback) : Route {

		return $this->collectRoute('GET', $path, $callback);

	}