/** * destroy vertex and all edges connected to it and remove reference from graph * * @uses Edge::destroy() * @uses Graph::removeVertex() */ public function destroy() { foreach ($this->edges as $edge) { $edge->destroy(); } $this->graph->removeVertex($this); }