@@ -7,28 +7,23 @@ class PHPCS_Diff_SVN {
77 private $ svn_password = '' ; // @todo: add your SVN password here
88
99 // Used to store details about the repo the class was initialized with.
10- public $ repo ; // Specific repository - eg.: plugin 's name .
10+ public $ repo ; // repository's slug .
1111 public $ repo_url ; // SVN repository URL.
12- public $ folder = '' ; // In case the repository has some other specific folders.
1312
14- function __construct ( $ repo, $ folder = false ) {
13+ function __construct ( $ repo ) {
1514
1615 $ repo = sanitize_title ( $ repo );
1716
1817 switch ( $ repo ) {
1918
2019 case 'hello-dolly ' :
21- $ this ->repo_url = 'https://plugins.svn.wordpress.org/ ' ;
20+ $ this ->repo_url = 'https://plugins.svn.wordpress.org/hello-dolly ' ;
2221 break ;
2322
2423 # Add new repos here. See details at the top of this file.
2524 }
2625
2726 $ this ->repo = $ repo ;
28-
29- if ( false !== $ folder && 0 === validate_file ( $ folder ) ) {
30- $ this ->folder = $ folder ;
31- }
3227 }
3328
3429 public function get_diff ( $ end_revision , $ start_revision = null , $ options = array () ) {
@@ -58,7 +53,7 @@ public function get_diff( $end_revision, $start_revision = null, $options = arra
5853 $ start_revision = 1 ;
5954 }
6055
61- $ repo_url = esc_url_raw ( trailingslashit ( $ this ->repo_url ) . trailingslashit ( $ this -> repo ) . $ this -> folder );
56+ $ repo_url = esc_url_raw ( trailingslashit ( $ this ->repo_url ) );
6257
6358 $ diff = shell_exec (
6459 sprintf ( 'svn diff %s --non-interactive --no-auth-cache --username %s --password %s -r %d:%d %s %s %s ' ,
@@ -164,7 +159,7 @@ public static function parse_diff_for_info( $diff_file ){
164159
165160 public function run_phpcs_for_file_at_revision ( $ filename , $ revision , $ phpcs_command , $ standards_location , $ phpcs_standard ) {
166161 $ command_string = sprintf ( 'svn cat %s --non-interactive --no-auth-cache --username %s --password %s -r %d | %s --runtime-set installed_paths %s --standard=%s --stdin-path=%s ' ,
167- escapeshellarg ( esc_url_raw ( $ this ->repo_url . $ filename ) ),
162+ escapeshellarg ( esc_url_raw ( trailingslashit ( $ this ->repo_url ) . $ filename ) ),
168163 escapeshellarg ( $ this ->svn_username ),
169164 escapeshellarg ( $ this ->svn_password ),
170165 absint ( $ revision ),
0 commit comments