public function findPages(): array
    {
        $foundPages = [];
        $root = $this->getPagesPath();

        if ($root) {
            $root .=  '/';

            foreach ($this->generatePageFiles($root) as $file) {
                $slug = $this->getSlug($root, $file);
                $foundPages[$slug] = (object)[
                    'info'=> $file,
                    'content' => $this->buildContentFunction($file),
                    'slug' => $slug,
                    'depth' => count(explode('/', $slug)),
                ];
            }
        }

        return $foundPages;
    }
public function findPages(): array
    {
        $foundPages = [];
        $root = $this->getPagesPath();

        if ($root) {
            $root .=  '/';

            foreach ($this->generatePageFiles($root) as $file) {
                $slug = $this->getSlug($root, $file);
                $foundPages[$slug] = (object)[
                    'info'=> $file,
                    'content' => $this->buildContentFunction($file),
                    'slug' => $slug,
                    'depth' => count(explode('/', $slug)),
                ];
            }
        }

        return $foundPages;
    }
public function findPages ( ) : array { $ foundPages = [ ] ; $ root = $ this -> getPagesPath ( ) ; if ( $ root ) { $ root .= '/' ; foreach ( $ this -> generatePageFiles ( $ root ) as $ file ) { $ slug = $ this -> getSlug ( $ root , $ file ) ; $ foundPages [ $ slug ] = ( object ) [ 'info' => $ file , 'content' => $ this -> buildContentFunction ( $ file ) , 'slug' => $ slug , 'depth' => count ( explode ( '/' , $ slug ) ) , ] ; } } return $ foundPages ; }
Produces array of page objects from discovered pages,
indexed by slug

@return array
Produces array of page objects from discovered pages indexed by slug