← All changes
|
app/modules/import-export/processes/export.php
+7
-10
4.2.2
→
3.10.0-dev1
View file →
| @@ -95,14 +95,13 @@ | ||
| 95 | 95 | /** |
| 96 | 96 | * Execute the export process. |
| 97 | 97 | * |
| 98 | 98 | * @return array The export data output. |
| 99 | - * | |
| 100 | - * @throws \Exception If no export runners have been specified. | |
| 99 | + * @throws \Exception | |
| 101 | 100 | */ |
| 102 | 101 | public function run() { |
| 103 | 102 | if ( empty( $this->runners ) ) { |
| 104 | - throw new \Exception( 'Couldn’t execute the export process because no export runners have been specified. Try again by specifying export runners.' ); | |
| 103 | + throw new \Exception( 'Please specify export runners.' ); | |
| 105 | 104 | } |
| 106 | 105 | |
| 107 | 106 | $this->set_default_settings(); |
| 108 | 107 | |
| @@ -153,10 +152,10 @@ | ||
| 153 | 152 | $this->settings_selected_plugins( $this->get_default_settings_selected_plugins() ); |
| 154 | 153 | } |
| 155 | 154 | } |
| 156 | 155 | |
| 157 | - public function settings_include( $included_settings ) { | |
| 158 | - $this->settings_include = $included_settings; | |
| 156 | + public function settings_include( $include ) { | |
| 157 | + $this->settings_include = $include; | |
| 159 | 158 | } |
| 160 | 159 | |
| 161 | 160 | public function get_settings_include() { |
| 162 | 161 | return $this->settings_include; |
| @@ -236,14 +235,12 @@ | ||
| 236 | 235 | } |
| 237 | 236 | |
| 238 | 237 | /** |
| 239 | 238 | * Init the zip archive. |
| 240 | - * | |
| 241 | - * @throws \Error If export process fails, file creation errors occur, or data serialization fails. | |
| 242 | 239 | */ |
| 243 | 240 | private function init_zip_archive() { |
| 244 | 241 | if ( ! class_exists( '\ZipArchive' ) ) { |
| 245 | - throw new \Error( static::ZIP_ARCHIVE_MODULE_MISSING ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped | |
| 242 | + throw new \Error( static::ZIP_ARCHIVE_MODULE_MISSING ); | |
| 246 | 243 | } |
| 247 | 244 | |
| 248 | 245 | $zip = new \ZipArchive(); |
| 249 | 246 | |
| @@ -312,10 +309,10 @@ | ||
| 312 | 309 | /** |
| 313 | 310 | * Add json file to the zip archive. |
| 314 | 311 | * |
| 315 | 312 | * @param string $path The relative path to the file. |
| 316 | - * @param array $content The content of the file. | |
| 317 | - * @param int $json_flags | |
| 313 | + * @param array $content The content of the file. | |
| 314 | + * @param int $json_flags | |
| 318 | 315 | */ |
| 319 | 316 | private function add_json_file( $path, array $content, $json_flags = 0 ) { |
| 320 | 317 | if ( ! Str::ends_with( $path, '.json' ) ) { |
| 321 | 318 | $path .= '.json'; |