original_string: public function toExtendedArray()
      {
          $items  = [];
          foreach ($this->items as $path => $slug) {
              $page = $this->pages->get($path);
  
              if ($page !== null) {
                  $items[$page->route()] = $page->toArray();
              }
          }
          return $items;
      }
code: public function toExtendedArray()
      {
          $items  = [];
          foreach ($this->items as $path => $slug) {
              $page = $this->pages->get($path);
  
              if ($page !== null) {
                  $items[$page->route()] = $page->toArray();
              }
          }
          return $items;
      }
code_tokens: public function toExtendedArray ( ) { $ items = [ ] ; foreach ( $ this -> items as $ path => $ slug ) { $ page = $ this -> pages -> get ( $ path ) ; if ( $ page !== null ) { $ items [ $ page -> route ( ) ] = $ page -> toArray ( ) ; } } return $ items ; }
docstring: Get the extended version of this Collection with each page keyed by route
  
  @return array
  @throws \Exception
docstring_tokens: Get the extended version of this Collection with each page keyed by route