original_string: public function find(PageDocument $page)
      {
          $request = $this->requestStack->getCurrentRequest();
  
          $template = $page->getDefault(AbstractPhpcrDocument::DEFAULT_TEMPLATE_KEY);
          if ($template === null) {
              $defaults = [];
  
              /** @var RouteEnhancerInterface $enhancer */
              foreach ($this->dynamicRouter->getRouteEnhancers() as $enhancer) {
                  $defaults = array_merge($defaults, $enhancer->enhance(['_content' => $page], $request));
              }
  
              if (array_key_exists(AbstractPhpcrDocument::DEFAULT_TEMPLATE_KEY, $defaults)) {
                  $template = $defaults[AbstractPhpcrDocument::DEFAULT_TEMPLATE_KEY];
              }
          }
  
          return $template;
      }
code: public function find(PageDocument $page)
      {
          $request = $this->requestStack->getCurrentRequest();
  
          $template = $page->getDefault(AbstractPhpcrDocument::DEFAULT_TEMPLATE_KEY);
          if ($template === null) {
              $defaults = [];
  
              /** @var RouteEnhancerInterface $enhancer */
              foreach ($this->dynamicRouter->getRouteEnhancers() as $enhancer) {
                  $defaults = array_merge($defaults, $enhancer->enhance(['_content' => $page], $request));
              }
  
              if (array_key_exists(AbstractPhpcrDocument::DEFAULT_TEMPLATE_KEY, $defaults)) {
                  $template = $defaults[AbstractPhpcrDocument::DEFAULT_TEMPLATE_KEY];
              }
          }
  
          return $template;
      }
code_tokens: public function find ( PageDocument $ page ) { $ request = $ this -> requestStack -> getCurrentRequest ( ) ; $ template = $ page -> getDefault ( AbstractPhpcrDocument :: DEFAULT_TEMPLATE_KEY ) ; if ( $ template === null ) { $ defaults = [ ] ; /** @var RouteEnhancerInterface $enhancer */ foreach ( $ this -> dynamicRouter -> getRouteEnhancers ( ) as $ enhancer ) { $ defaults = array_merge ( $ defaults , $ enhancer -> enhance ( [ '_content' => $ page ] , $ request ) ) ; } if ( array_key_exists ( AbstractPhpcrDocument :: DEFAULT_TEMPLATE_KEY , $ defaults ) ) { $ template = $ defaults [ AbstractPhpcrDocument :: DEFAULT_TEMPLATE_KEY ] ; } } return $ template ; }
docstring: Returns the default template for a given page
  
  @param PageDocument $page
  
  @return string|null
docstring_tokens: Returns the default template for a given page