diff --git a/admin-command.php b/admin-command.php index 25eac29..b96329b 100644 --- a/admin-command.php +++ b/admin-command.php @@ -7,7 +7,7 @@ /** * Open /wp-admin/ in a browser. */ -$wp_admin = function() { +function wp_cli_admin_command() { switch ( strtoupper( substr( PHP_OS, 0, 3 ) ) ) { case 'DAR': $exec = 'open'; @@ -19,5 +19,5 @@ $exec = 'xdg-open'; } passthru( $exec . ' ' . escapeshellarg( admin_url() ) ); -}; -WP_CLI::add_command( 'admin', $wp_admin ); +} +WP_CLI::add_command( 'admin', 'wp_cli_admin_command' ); diff --git a/composer.json b/composer.json index 9c3b2df..bda1de0 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "wp-cli/wp-cli": "^2" }, "require-dev": { - "wp-cli/wp-cli-tests": "^3.0.11" + "wp-cli/wp-cli-tests": "^4" }, "config": { "process-timeout": 7200, @@ -38,6 +38,7 @@ "behat-rerun": "rerun-behat-tests", "lint": "run-linter-tests", "phpcs": "run-phpcs-tests", + "phpcbf": "run-phpcbf-cleanup", "phpunit": "run-php-unit-tests", "prepare-tests": "install-package-tests", "test": [ diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..ea0a892 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,55 @@ + + + Custom ruleset for WP-CLI admin-command + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */src/Admin_Command\.php$ + + +