original_string: public function getModuleIdFromZip($file)
      {
          $list = $this->getFilesFromZip($file);
  
          if (empty($list)) {
              return false;
          }
  
          $folder = reset($list);
  
          if (strrchr($folder, '/') !== '/') {
              return false;
          }
  
          $nested = 0;
          foreach ($list as $item) {
              if (strpos($item, $folder) === 0) {
                  $nested++;
              }
          }
  
          if (count($list) != $nested) {
              return false;
          }
  
          return rtrim($folder, '/');
      }
code: public function getModuleIdFromZip($file)
      {
          $list = $this->getFilesFromZip($file);
  
          if (empty($list)) {
              return false;
          }
  
          $folder = reset($list);
  
          if (strrchr($folder, '/') !== '/') {
              return false;
          }
  
          $nested = 0;
          foreach ($list as $item) {
              if (strpos($item, $folder) === 0) {
                  $nested++;
              }
          }
  
          if (count($list) != $nested) {
              return false;
          }
  
          return rtrim($folder, '/');
      }
code_tokens: public function getModuleIdFromZip ( $ file ) { $ list = $ this -> getFilesFromZip ( $ file ) ; if ( empty ( $ list ) ) { return false ; } $ folder = reset ( $ list ) ; if ( strrchr ( $ folder , '/' ) !== '/' ) { return false ; } $ nested = 0 ; foreach ( $ list as $ item ) { if ( strpos ( $ item , $ folder ) === 0 ) { $ nested ++ ; } } if ( count ( $ list ) != $ nested ) { return false ; } return rtrim ( $ folder , '/' ) ; }
docstring: Returns a module id from a zip file or false on error
  @param string $file
  @return boolean|string
docstring_tokens: Returns a module id from a zip file or false on error