Skip to content

Commit 0d519df

Browse files
Copilotswissspidy
andcommitted
Address code review feedback: fix command args escaping and rename subcommand
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 6058af0 commit 0d519df

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"core update",
4949
"core update-db",
5050
"core version",
51-
"core version-actual-db"
51+
"core version-db-actual"
5252
]
5353
},
5454
"autoload": {

src/Core_Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -947,11 +947,11 @@ public function version( $args = [], $assoc_args = [] ) {
947947
if ( true === $value ) {
948948
$cmd_args[] = "--{$key}";
949949
} elseif ( is_string( $value ) ) {
950-
$cmd_args[] = "--{$key}=" . escapeshellarg( $value );
950+
$cmd_args[] = "--{$key}={$value}";
951951
}
952952
}
953953
}
954-
$cmd = 'core version-actual-db ' . implode( ' ', $cmd_args );
954+
$cmd = 'core version-db-actual ' . implode( ' ', $cmd_args );
955955

956956
WP_CLI::runcommand(
957957
$cmd,
@@ -994,13 +994,13 @@ public function version( $args = [], $assoc_args = [] ) {
994994
*
995995
* This is an internal command called by 'core version --actual'.
996996
*
997-
* @subcommand version-actual-db
997+
* @subcommand version-db-actual
998998
* @when after_wp_load
999999
*
10001000
* @param string[] $args Positional arguments. Unused.
10011001
* @param array{extra?: bool} $assoc_args Associative arguments.
10021002
*/
1003-
public function version_actual_db( $args = [], $assoc_args = [] ) {
1003+
public function version_db_actual( $args = [], $assoc_args = [] ) {
10041004
$details = self::get_wp_details();
10051005

10061006
// Get the actual database version from the options table

0 commit comments

Comments
 (0)