Skip to content

Remove Vertices and Edges collection classes, use plain arrays instead #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 17, 2020

Conversation

clue
Copy link
Member

@clue clue commented Aug 17, 2020

This changeset removes the Vertices and Edges collection classes and changes the code to use plain arrays instead. These collection classes (incorrectly named "sets") added some very significant complexity to the code base and bring little value for this package. Some of their methods were specifically designed for specific algorithms, so we'll port these over to graphp/algorithms as appropriate (#119).

// old
$vertices = $edge->getVertices()->getVector();
$edges = $vertex->getEdges()->getVector();
$vertex = $edge->getVertices()->getVertexFirst();
$edge = $vertex->getEdges()->getEdgeFirst();

// new
$vertices = $edge->getVertices();
$edges = $vertex->getEdges();
$vertex = \reset($vertices);
$edge = \reset($edges);

Builds on top of #188, #185 and others.

@clue clue added this to the v1.0.0 milestone Aug 17, 2020
@clue clue changed the title Remove Vertices and `Edges collection classes, use plain arrays instead Remove Vertices and Edges collection classes, use plain arrays instead Aug 17, 2020
@clue clue merged commit 214de45 into graphp:master Aug 17, 2020
@clue clue deleted the remove-sets branch August 17, 2020 16:18
llaville added a commit to llaville/graph-uml that referenced this pull request Sep 10, 2020
@clue clue mentioned this pull request Dec 30, 2021
clue added a commit to clue-labs/graphviz that referenced this pull request Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant