Gliph\Graph\DirectedAdjacencyList::inDegreeOf PHP Метод

inDegreeOf() публичный Метод

public inDegreeOf ( $vertex )
    public function inDegreeOf($vertex)
    {
        if (!$this->hasVertex($vertex)) {
            throw new NonexistentVertexException('Vertex is not in the graph, in-degree information cannot be provided', E_WARNING);
        }
        $count = 0;
        foreach ($this->vertices() as $v) {
            if ($this->vertices[$v]->contains($vertex)) {
                $count++;
            }
        }
        return $count;
    }