original_string: public function get_parent() {
          if ($this->lf->get_filepath() === '/' and $this->lf->is_directory()) {
              if ($this->areaonly) {
                  return null;
              } else if ($this->itemidused) {
                  return $this->browser->get_file_info($this->context, $this->lf->get_component(), $this->lf->get_filearea());
              } else {
                  return $this->browser->get_file_info($this->context);
              }
          }
  
          if (!$this->lf->is_directory()) {
              return $this->browser->get_file_info($this->context, $this->lf->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid(), $this->lf->get_filepath(), '.');
          }
  
          $filepath = $this->lf->get_filepath();
          $filepath = trim($filepath, '/');
          $dirs = explode('/', $filepath);
          array_pop($dirs);
          $filepath = implode('/', $dirs);
          $filepath = ($filepath === '') ? '/' : "/$filepath/";
  
          return $this->browser->get_file_info($this->context, $this->lf->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid(), $filepath, '.');
      }
code: public function get_parent() {
          if ($this->lf->get_filepath() === '/' and $this->lf->is_directory()) {
              if ($this->areaonly) {
                  return null;
              } else if ($this->itemidused) {
                  return $this->browser->get_file_info($this->context, $this->lf->get_component(), $this->lf->get_filearea());
              } else {
                  return $this->browser->get_file_info($this->context);
              }
          }
  
          if (!$this->lf->is_directory()) {
              return $this->browser->get_file_info($this->context, $this->lf->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid(), $this->lf->get_filepath(), '.');
          }
  
          $filepath = $this->lf->get_filepath();
          $filepath = trim($filepath, '/');
          $dirs = explode('/', $filepath);
          array_pop($dirs);
          $filepath = implode('/', $dirs);
          $filepath = ($filepath === '') ? '/' : "/$filepath/";
  
          return $this->browser->get_file_info($this->context, $this->lf->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid(), $filepath, '.');
      }
code_tokens: public function get_parent ( ) { if ( $ this -> lf -> get_filepath ( ) === '/' and $ this -> lf -> is_directory ( ) ) { if ( $ this -> areaonly ) { return null ; } else if ( $ this -> itemidused ) { return $ this -> browser -> get_file_info ( $ this -> context , $ this -> lf -> get_component ( ) , $ this -> lf -> get_filearea ( ) ) ; } else { return $ this -> browser -> get_file_info ( $ this -> context ) ; } } if ( ! $ this -> lf -> is_directory ( ) ) { return $ this -> browser -> get_file_info ( $ this -> context , $ this -> lf -> get_component ( ) , $ this -> lf -> get_filearea ( ) , $ this -> lf -> get_itemid ( ) , $ this -> lf -> get_filepath ( ) , '.' ) ; } $ filepath = $ this -> lf -> get_filepath ( ) ; $ filepath = trim ( $ filepath , '/' ) ; $ dirs = explode ( '/' , $ filepath ) ; array_pop ( $ dirs ) ; $ filepath = implode ( '/' , $ dirs ) ; $ filepath = ( $ filepath === '' ) ? '/' : "/$filepath/" ; return $ this -> browser -> get_file_info ( $ this -> context , $ this -> lf -> get_component ( ) , $ this -> lf -> get_filearea ( ) , $ this -> lf -> get_itemid ( ) , $ filepath , '.' ) ; }
docstring: Returns parent file_info instance
  
  @return file_info|null file_info instance or null for root
docstring_tokens: Returns parent file_info instance