protected function createIndex()
    {
        $tree = [];

        foreach ($this->classDefinitions as $className => $classInfo) {
            $current = & $tree;

            foreach (explode('\\', $className) as $part) {
                if (!isset($current[$part])) {
                    $current[$part] = [];
                }

                $current = & $current[$part];
            }
        }

        /**
         * This will be a reference to the $treeOutput closure, so that it can be invoked
         * recursively. A string is used to trick static analysers into thinking this might be
         * callable.
         */
        $treeOutput = '';

        $treeOutput = function($item, $fullString = '', $depth = 0) use (&$treeOutput) {
            $output = '';

            foreach ($item as $name => $subItems) {
                $fullName = $name;

                if ($fullString) {
                    $fullName = $fullString . '\\' . $name;
                }

                $output .= str_repeat(' ', $depth * 4) . '* ' . Generator::classLink($fullName, $name) . "\n";
                $output .= $treeOutput($subItems, $fullName, $depth + 1);
            }

            return $output;
        };

        return $treeOutput($tree);
    }
protected function createIndex()
    {
        $tree = [];

        foreach ($this->classDefinitions as $className => $classInfo) {
            $current = & $tree;

            foreach (explode('\\', $className) as $part) {
                if (!isset($current[$part])) {
                    $current[$part] = [];
                }

                $current = & $current[$part];
            }
        }

        /**
         * This will be a reference to the $treeOutput closure, so that it can be invoked
         * recursively. A string is used to trick static analysers into thinking this might be
         * callable.
         */
        $treeOutput = '';

        $treeOutput = function($item, $fullString = '', $depth = 0) use (&$treeOutput) {
            $output = '';

            foreach ($item as $name => $subItems) {
                $fullName = $name;

                if ($fullString) {
                    $fullName = $fullString . '\\' . $name;
                }

                $output .= str_repeat(' ', $depth * 4) . '* ' . Generator::classLink($fullName, $name) . "\n";
                $output .= $treeOutput($subItems, $fullName, $depth + 1);
            }

            return $output;
        };

        return $treeOutput($tree);
    }
protected function createIndex ( ) { $ tree = [ ] ; foreach ( $ this -> classDefinitions as $ className => $ classInfo ) { $ current = & $ tree ; foreach ( explode ( '\\' , $ className ) as $ part ) { if ( ! isset ( $ current [ $ part ] ) ) { $ current [ $ part ] = [ ] ; } $ current = & $ current [ $ part ] ; } } /**
         * This will be a reference to the $treeOutput closure, so that it can be invoked
         * recursively. A string is used to trick static analysers into thinking this might be
         * callable.
         */ $ treeOutput = '' ; $ treeOutput = function ( $ item , $ fullString = '' , $ depth = 0 ) use ( & $ treeOutput ) { $ output = '' ; foreach ( $ item as $ name => $ subItems ) { $ fullName = $ name ; if ( $ fullString ) { $ fullName = $ fullString . '\\' . $ name ; } $ output .= str_repeat ( ' ' , $ depth * 4 ) . '* ' . Generator :: classLink ( $ fullName , $ name ) . "\n" ; $ output .= $ treeOutput ( $ subItems , $ fullName , $ depth + 1 ) ; } return $ output ; } ; return $ treeOutput ( $ tree ) ; }
Creates an index of classes and namespaces.

I'm generating the actual markdown output here, which isn't great...But it will have to do.
If I don't want to make things too complicated.

@return array
Creates an index of classes and namespaces .