public function sort()
    {
        foreach ($this->nodeList as $definition) {
            if ($definition->state !== Vertex::NOT_VISITED) {
                continue;
            }

            $this->visit($definition);
        }

        $sortedList = $this->sortedNodeList;

        $this->nodeList       = [];
        $this->sortedNodeList = [];

        return $sortedList;
    }
public function sort()
    {
        foreach ($this->nodeList as $definition) {
            if ($definition->state !== Vertex::NOT_VISITED) {
                continue;
            }

            $this->visit($definition);
        }

        $sortedList = $this->sortedNodeList;

        $this->nodeList       = [];
        $this->sortedNodeList = [];

        return $sortedList;
    }
public function sort ( ) { foreach ( $ this -> nodeList as $ definition ) { if ( $ definition -> state !== Vertex :: NOT_VISITED ) { continue ; } $ this -> visit ( $ definition ) ; } $ sortedList = $ this -> sortedNodeList ; $ this -> nodeList = [ ] ; $ this -> sortedNodeList = [ ] ; return $ sortedList ; }
Return a valid order list of all current nodes.
The desired topological sorting is the postorder of these searches.

Note: Highly performance-sensitive method.

@throws \RuntimeException
@throws CircularReferenceException

@return array
Return a valid order list of all current nodes . The desired topological sorting is the postorder of these searches .