Neos.ContentRepository/Classes/Service/Utility/NodePublishingDependencySolver.php
protected function resolveDependencies()
    {
        $sortedNodes = [];
        while (count($this->nodesWithoutIncoming) > 0) {
            $node = array_pop($this->nodesWithoutIncoming);
            $sortedNodes[] = $node;
            $nodeHash = spl_object_hash($node);
            if (isset($this->dependenciesOutgoing[$nodeHash])) {
                foreach ($this->dependenciesOutgoing[$nodeHash] as $dependencyHash => $dependencyNode) {
                    unset($this->dependenciesOutgoing[$nodeHash][$dependencyHash]);
                    unset($this->dependenciesIncoming[$dependencyHash][$nodeHash]);

                    if (count($this->dependenciesIncoming[$dependencyHash]) === 0) {
                        $this->nodesWithoutIncoming[$dependencyHash] = $dependencyNode;
                    }
                }
            }
        }
        return $sortedNodes;
    }
protected function resolveDependencies()
    {
        $sortedNodes = [];
        while (count($this->nodesWithoutIncoming) > 0) {
            $node = array_pop($this->nodesWithoutIncoming);
            $sortedNodes[] = $node;
            $nodeHash = spl_object_hash($node);
            if (isset($this->dependenciesOutgoing[$nodeHash])) {
                foreach ($this->dependenciesOutgoing[$nodeHash] as $dependencyHash => $dependencyNode) {
                    unset($this->dependenciesOutgoing[$nodeHash][$dependencyHash]);
                    unset($this->dependenciesIncoming[$dependencyHash][$nodeHash]);

                    if (count($this->dependenciesIncoming[$dependencyHash]) === 0) {
                        $this->nodesWithoutIncoming[$dependencyHash] = $dependencyNode;
                    }
                }
            }
        }
        return $sortedNodes;
    }
protected function resolveDependencies ( ) { $ sortedNodes = [ ] ; while ( count ( $ this -> nodesWithoutIncoming ) > 0 ) { $ node = array_pop ( $ this -> nodesWithoutIncoming ) ; $ sortedNodes [ ] = $ node ; $ nodeHash = spl_object_hash ( $ node ) ; if ( isset ( $ this -> dependenciesOutgoing [ $ nodeHash ] ) ) { foreach ( $ this -> dependenciesOutgoing [ $ nodeHash ] as $ dependencyHash => $ dependencyNode ) { unset ( $ this -> dependenciesOutgoing [ $ nodeHash ] [ $ dependencyHash ] ) ; unset ( $ this -> dependenciesIncoming [ $ dependencyHash ] [ $ nodeHash ] ) ; if ( count ( $ this -> dependenciesIncoming [ $ dependencyHash ] ) === 0 ) { $ this -> nodesWithoutIncoming [ $ dependencyHash ] = $ dependencyNode ; } } } } return $ sortedNodes ; }
Resolve node dependencies

1. Pick a node from the set of nodes without incoming dependencies
2. For all dependencies of that node:
2a. Remove the dependency
2b. If the dependency has no other incoming dependencies itself, add it to the set of nodes without incoming dependencies

@return array Sorted list of nodes (not all dependencies might be solved)
Resolve node dependencies