original_string: public function all(PageInterface $current = null)
      {
          $all = new Collection();
  
          /** @var PageInterface $current */
          $current = $current ?: $this->root();
  
          if (!$current->root()) {
              $all[$current->path()] = ['slug' => $current->slug()];
          }
  
          foreach ($current->children() as $next) {
              $all->append($this->all($next));
          }
  
          return $all;
      }
code: public function all(PageInterface $current = null)
      {
          $all = new Collection();
  
          /** @var PageInterface $current */
          $current = $current ?: $this->root();
  
          if (!$current->root()) {
              $all[$current->path()] = ['slug' => $current->slug()];
          }
  
          foreach ($current->children() as $next) {
              $all->append($this->all($next));
          }
  
          return $all;
      }
code_tokens: public function all ( PageInterface $ current = null ) { $ all = new Collection ( ) ; /** @var PageInterface $current */ $ current = $ current ? : $ this -> root ( ) ; if ( ! $ current -> root ( ) ) { $ all [ $ current -> path ( ) ] = [ 'slug' => $ current -> slug ( ) ] ; } foreach ( $ current -> children ( ) as $ next ) { $ all -> append ( $ this -> all ( $ next ) ) ; } return $ all ; }
docstring: Get all pages
  
  @param PageInterface $current
  
  @return \Grav\Common\Page\Collection
docstring_tokens: Get all pages