Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to WPCS v3 #240

Merged
merged 4 commits into from
Aug 30, 2023
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"require-dev": {
"wp-cli/entity-command": "^1.3 || ^2",
"wp-cli/wp-cli-tests": "^3.1"
"wp-cli/wp-cli-tests": "^4"
},
"config": {
"process-timeout": 7200,
Expand Down
2 changes: 1 addition & 1 deletion db-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
return;
}

$wpcli_db_autoloader = dirname( __FILE__ ) . '/vendor/autoload.php';
$wpcli_db_autoloader = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $wpcli_db_autoloader ) ) {
require_once $wpcli_db_autoloader;
}
Expand Down
8 changes: 3 additions & 5 deletions src/DB_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ public function size( $args, $assoc_args ) {
if ( $orderby ) {
usort(
$rows,
function( $a, $b ) use ( $order, $orderby ) {
function ( $a, $b ) use ( $order, $orderby ) {

$orderby_array = 'asc' === $order ? array( $a, $b ) : array( $b, $a );
list( $first, $second ) = $orderby_array;
Expand Down Expand Up @@ -1373,11 +1373,9 @@ public function search( $args, $assoc_args ) {
if ( ! $text_columns ) {
if ( $stats ) {
$skipped[] = $table;
} else {
// Don't bother warning for term relationships (which is just 3 int columns).
if ( ! preg_match( '/_term_relationships$/', $table ) ) {
WP_CLI::warning( $primary_keys ? "No text columns for table '$table' - skipped." : "No primary key or text columns for table '$table' - skipped." );
}
} elseif ( ! preg_match( '/_term_relationships$/', $table ) ) {
WP_CLI::warning( $primary_keys ? "No text columns for table '$table' - skipped." : "No primary key or text columns for table '$table' - skipped." );
}
continue;
}
Expand Down