Skip to content

Commit

Permalink
Use command namespaces instead of conditional addition
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Sep 5, 2018
1 parent 6e0b5f6 commit 76289ab
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
11 changes: 5 additions & 6 deletions checksum-command.php
Expand Up @@ -9,10 +9,9 @@
require_once $autoload;
}

WP_CLI::add_hook( 'after_add_command:core', function () {
WP_CLI::add_command( 'core verify-checksums', 'Checksum_Core_Command' );
} );
WP_CLI::add_command( 'core', 'Core_Command_Namespace' );
WP_CLI::add_command( 'core verify-checksums', 'Checksum_Core_Command' );

WP_CLI::add_command( 'plugin', 'Plugin_Command_Namespace' );
WP_CLI::add_command( 'plugin verify-checksums', 'Checksum_Plugin_Command' );

WP_CLI::add_hook( 'after_add_command:plugin', function () {
WP_CLI::add_command( 'plugin verify-checksums', 'Checksum_Plugin_Command' );
} );
10 changes: 10 additions & 0 deletions src/Core_Command_Namespace.php
@@ -0,0 +1,10 @@
<?php

use WP_CLI\Dispatcher\CommandNamespace;

/**
* Downloads, installs, updates, and manages a WordPress installation.
*/
final class Core_Command_Namespace extends CommandNamespace {

}
10 changes: 10 additions & 0 deletions src/Plugin_Command_Namespace.php
@@ -0,0 +1,10 @@
<?php

use WP_CLI\Dispatcher\CommandNamespace;

/**
* Manages plugins, including installs, activations, and updates.
*/
final class Plugin_Command_Namespace extends CommandNamespace {

}

0 comments on commit 76289ab

Please sign in to comment.