original_string: public function topParent()
      {
          $topParent = $this->parent();
  
          if (!$topParent) {
              return null;
          }
  
          while (true) {
              $theParent = $topParent->parent();
              if ($theParent !== null && $theParent->parent() !== null) {
                  $topParent = $theParent;
              } else {
                  break;
              }
          }
  
          return $topParent;
      }
code: public function topParent()
      {
          $topParent = $this->parent();
  
          if (!$topParent) {
              return null;
          }
  
          while (true) {
              $theParent = $topParent->parent();
              if ($theParent !== null && $theParent->parent() !== null) {
                  $topParent = $theParent;
              } else {
                  break;
              }
          }
  
          return $topParent;
      }
code_tokens: public function topParent ( ) { $ topParent = $ this -> parent ( ) ; if ( ! $ topParent ) { return null ; } while ( true ) { $ theParent = $ topParent -> parent ( ) ; if ( $ theParent !== null && $ theParent -> parent ( ) !== null ) { $ topParent = $ theParent ; } else { break ; } } return $ topParent ; }
docstring: Gets the top parent object for this page
  
  @return PageInterface|null the top parent page object if it exists.
docstring_tokens: Gets the top parent object for this page