graphp / graph

GraPHP is the mathematical graph/network library written in PHP.
MIT License
694 stars 74 forks source link

Support ordering vertices and edges by custom callbacks, remove all `ORDER_*` consts #181

Closed clue closed 5 years ago

clue commented 5 years ago
// old
$vertices->getVerticesOrder(Vertices::ORDER_ID);

// new
$vertices->getVerticesOrder(function (Vertex $vertex) {
    return $vertex->getId();
});

Among others, this is done in preparation for #114 (also refs #131). Builds on top of #180 and #179.