CommitOrderCalculator
class CommitOrderCalculator (View source)
CommitOrderCalculator implements topological sorting, which is an ordering algorithm for directed graphs (DG) and/or directed acyclic graphs (DAG) by using a depthfirst searching (DFS) to traverse the graph built in memory.
This algorithm have a linear running time based on nodes (V) and dependency between the nodes (E), resulting in a computational complexity of O(V + E).
Constants
NOT_VISITED 

IN_PROGRESS 

VISITED 

Methods
Checks for node (vertex) existence in graph.
Adds a new node (vertex) to the graph, assigning its hash and value.
Adds a new dependency (edge) to the graph using their hashes.
Return a valid order list of all current nodes.
Details
at line 55
bool
hasNode(string $hash)
Checks for node (vertex) existence in graph.
at line 66
addNode(string $hash, object $node)
Adds a new node (vertex) to the graph, assigning its hash and value.
at line 85
addDependency(string $fromHash, string $toHash, int $weight)
Adds a new dependency (edge) to the graph using their hashes.
at line 105
object[]
sort()
Return a valid order list of all current nodes.
The desired topological sorting is the reverse post order of these searches.
{@internal Highly performancesensitive method. }}