Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions php/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1280,38 +1280,6 @@ function phar_safe_path( $path ) {
);
}

/**
* Check whether a given Command object is part of the bundled set of
* commands.
*
* This function accepts both a fully qualified class name as a string as
* well as an object that extends `WP_CLI\Dispatcher\CompositeCommand`.
*
* @param \WP_CLI\Dispatcher\CompositeCommand|string $command
* @return bool
*/
function is_bundled_command( $command ) {
static $classes;

if ( null === $classes ) {
$classes = array();
// TODO: This needs to be rebuilt.
// $class_map = WP_CLI_VENDOR_DIR . '/composer/autoload_commands_classmap.php';
// if ( file_exists( WP_CLI_VENDOR_DIR . '/composer/' ) ) {
// $classes = include $class_map;
// }
$classes = array( 'CLI_Command' => true );
}

if ( is_object( $command ) ) {
$command = get_class( $command );
}

return is_string( $command )
? array_key_exists( $command, $classes )
: false;
}

/**
* Maybe prefix command string with "/usr/bin/env".
* Removes (if there) if Windows, adds (if not there) if not.
Expand Down
46 changes: 0 additions & 46 deletions tests/test-bundled-commands.php

This file was deleted.