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 #110

Merged
merged 8 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -21,7 +21,7 @@
"wp-cli/extension-command": "^1.2 || ^2",
"wp-cli/import-command": "^1 || ^2",
"wp-cli/media-command": "^1 || ^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 export-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
return;
}

$wpcli_export_autoloader = dirname( __FILE__ ) . '/vendor/autoload.php';
$wpcli_export_autoloader = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $wpcli_export_autoloader ) ) {
require_once $wpcli_export_autoloader;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Export_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* # Export posts published by the user between given start and end date
* $ wp export --dir=/tmp/ --user=admin --post_type=post --start_date=2011-01-01 --end_date=2011-12-31
* Starting export process...
* Writing to file /tmp/staging.wordpress.2016-05-24.000.xml
* Writing to file /tmp/staging.WordPress.2016-05-24.000.xml
* Success: All done with export.
*
* @package wp-cli
Expand Down Expand Up @@ -58,7 +58,7 @@ class Export_Command extends WP_CLI_Command {
* ---
*
* [--filename_format=<format>]
* : Use a custom format for export filenames. Defaults to '{site}.wordpress.{date}.{n}.xml'.
* : Use a custom format for export filenames. Defaults to '{site}.WordPress.{date}.{n}.xml'.
*
* [--include_once=<before_posts>]
* : Include specified export section only in the first export file. Valid options
Expand Down Expand Up @@ -111,19 +111,19 @@ class Export_Command extends WP_CLI_Command {
* # Export posts published by the user between given start and end date
* $ wp export --dir=/tmp/ --user=admin --post_type=post --start_date=2011-01-01 --end_date=2011-12-31
* Starting export process...
* Writing to file /tmp/staging.wordpress.2016-05-24.000.xml
* Writing to file /tmp/staging.WordPress.2016-05-24.000.xml
* Success: All done with export.
*
* # Export posts by IDs
* $ wp export --dir=/tmp/ --post__in=123,124,125
* Starting export process...
* Writing to file /tmp/staging.wordpress.2016-05-24.000.xml
* Writing to file /tmp/staging.WordPress.2016-05-24.000.xml
* Success: All done with export.
*
* # Export a random subset of content
* $ wp export --post__in="$(wp post list --post_type=post --orderby=rand --posts_per_page=8 --format=ids)"
* Starting export process...
* Writing to file /var/www/example.com/public_html/staging.wordpress.2016-05-24.000.xml
* Writing to file /var/www/example.com/public_html/staging.WordPress.2016-05-24.000.xml
* Success: All done with export.
*/
public function __invoke( $_, $assoc_args ) {
Expand Down
1 change: 0 additions & 1 deletion src/WP_Export_Oxymel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ public function cdata( $text ) {
return parent::cdata( $text );
}
}

1 change: 0 additions & 1 deletion src/WP_Export_Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,4 +413,3 @@ private function get_comments_for_post( $post ) {
return $comments;
}
}

3 changes: 1 addition & 2 deletions src/WP_Export_Split_Files_Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ private function close_current_file() {

private function next_file_name() {
$next_file_name = sprintf( $this->filename_template, $this->next_file_number );
$this->next_file_number++;
++$this->next_file_number;
return $next_file_name;
}

private function next_file_path() {
return untrailingslashit( $this->destination_directory ) . DIRECTORY_SEPARATOR . $this->next_file_name();
}

}
1 change: 0 additions & 1 deletion src/WP_Export_WXR_Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public function header() {
)
->open_channel
->to_string();

}

public function site_metadata() {
Expand Down
4 changes: 2 additions & 2 deletions src/WP_Post_IDs_Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function key() {
}

public function next() {
$this->index_in_results++;
$this->global_index++;
++$this->index_in_results;
++$this->global_index;
}

public function rewind() {
Expand Down