original_string: private function SortFilesByVersion(array $files)
      {
          $result = array();
          $foreignKeysFile = '';
          foreach ($files as $file)
          {
              if ($file == 'foreign-keys.sql')
              {
                  $foreignKeysFile = $file;
                  continue;
              }
              $version = Path::RemoveExtension($file);
              if ($this->installedVersion && version_compare($version, $this->installedVersion) <= 0)
              {
                  continue;
              }
              $result[$version] = $file;
          }
          uksort($result, "version_compare");
          if ($foreignKeysFile)
          {
              $result[] = $foreignKeysFile;
          }
          return $result;
      }
code: private function SortFilesByVersion(array $files)
      {
          $result = array();
          $foreignKeysFile = '';
          foreach ($files as $file)
          {
              if ($file == 'foreign-keys.sql')
              {
                  $foreignKeysFile = $file;
                  continue;
              }
              $version = Path::RemoveExtension($file);
              if ($this->installedVersion && version_compare($version, $this->installedVersion) <= 0)
              {
                  continue;
              }
              $result[$version] = $file;
          }
          uksort($result, "version_compare");
          if ($foreignKeysFile)
          {
              $result[] = $foreignKeysFile;
          }
          return $result;
      }
code_tokens: private function SortFilesByVersion ( array $ files ) { $ result = array ( ) ; $ foreignKeysFile = '' ; foreach ( $ files as $ file ) { if ( $ file == 'foreign-keys.sql' ) { $ foreignKeysFile = $ file ; continue ; } $ version = Path :: RemoveExtension ( $ file ) ; if ( $ this -> installedVersion && version_compare ( $ version , $ this -> installedVersion ) <= 0 ) { continue ; } $ result [ $ version ] = $ file ; } uksort ( $ result , "version_compare" ) ; if ( $ foreignKeysFile ) { $ result [ ] = $ foreignKeysFile ; } return $ result ; }
docstring: Sorts files by version
  @param string[] $files The files
  @return string[] Returns the sorted files
docstring_tokens: Sorts files by version