diff --git a/.gitignore b/.gitignore index 6711a81..0346fa9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ composer.lock node_modules/ vendor/ *.log +phpunit.xml +phpcs.xml +.phpcs.xml diff --git a/composer.json b/composer.json index 2d116a0..c8d60c3 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require-dev": { "behat/behat": "~2.5", - "wp-cli/wp-cli-tests": "^2", + "wp-cli/wp-cli-tests": "^2.1", "wp-cli/scaffold-command": "^2", "wp-cli/extension-command": "^2" }, diff --git a/dist-archive-command.php b/dist-archive-command.php index b7df159..9fa9731 100644 --- a/dist-archive-command.php +++ b/dist-archive-command.php @@ -4,9 +4,9 @@ return; } -$autoload = dirname( __FILE__ ) . '/vendor/autoload.php'; -if ( file_exists( $autoload ) ) { - require_once $autoload; +$wpcli_dist_archive_autoloader = dirname( __FILE__ ) . '/vendor/autoload.php'; +if ( file_exists( $wpcli_dist_archive_autoloader ) ) { + require_once $wpcli_dist_archive_autoloader; } WP_CLI::add_command( 'dist-archive', 'Dist_Archive_Command' ); diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 1663286..e3ffbdd 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,61 +1,55 @@ - - Custom ruleset for WP-CLI + + Custom ruleset for WP-CLI dist-archive-command + + + + + . - - + + - - . - - */.git/* - */ci/* - */features/* - */packages/* - */tests/* - */utils/* - */vendor/* - - - - - - - - - - - - - - + + - - + + - - - */php/commands/src/CLI_Command.php - + - - - - - - - + + + - - + + + + + + - + + + + - - + + diff --git a/src/Dist_Archive_Command.php b/src/Dist_Archive_Command.php index 8523288..b0d3f09 100644 --- a/src/Dist_Archive_Command.php +++ b/src/Dist_Archive_Command.php @@ -145,7 +145,8 @@ function( $ignored_file ) { $ignored_file = substr( $ignored_file, 0, ( strlen( $ignored_file ) - 2 ) ); } return "--exclude='{$ignored_file}'"; - }, $ignored_files + }, + $ignored_files ); $excludes = implode( ' ', $excludes ); $cmd = "tar {$excludes} -zcvf {$archive_file} {$archive_base}";