fix phpcs errors
This commit is contained in:
parent
943e9f1869
commit
2800be9b7b
|
@ -229,11 +229,11 @@ class WC_WCCOM_Site {
|
||||||
require_once WC_ABSPATH . 'includes/wccom-site/installation/class-wc-wccom-site-installation-manager.php';
|
require_once WC_ABSPATH . 'includes/wccom-site/installation/class-wc-wccom-site-installation-manager.php';
|
||||||
|
|
||||||
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/interface-installaton-step.php';
|
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/interface-installaton-step.php';
|
||||||
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-installation-step-product-info.php';
|
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-wc-wccom-site-installation-step-get-product-info.php';
|
||||||
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-installation-step-download-product.php';
|
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-wc-wccom-site-installation-step-download-product.php';
|
||||||
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-installation-step-unpack-product.php';
|
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-wc-wccom-site-installation-step-unpack-product.php';
|
||||||
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-installation-step-move-product.php';
|
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-wc-wccom-site-installation-step-move-product.php';
|
||||||
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-installation-step-activate-product.php';
|
require_once WC_ABSPATH . 'includes/wccom-site/installation/installation-steps/class-wc-wccom-site-installation-step-activate-product.php';
|
||||||
|
|
||||||
$namespaces['wccom-site/v1'] = array(
|
$namespaces['wccom-site/v1'] = array(
|
||||||
'installer' => 'WC_REST_WCCOM_Site_Installer_Controller',
|
'installer' => 'WC_REST_WCCOM_Site_Installer_Controller',
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Installation Manager
|
||||||
|
*
|
||||||
|
* @package WooCommerce\WCCom\Installation
|
||||||
|
*/
|
||||||
|
|
||||||
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
||||||
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
||||||
|
@ -79,7 +84,8 @@ class WC_WCCOM_Site_Installation_Manager {
|
||||||
throw new Installer_Error( Installer_Error_Codes::ALL_INSTALLATION_STEPS_RUN );
|
throw new Installer_Error( Installer_Error_Codes::ALL_INSTALLATION_STEPS_RUN );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_search($state->get_last_step_name(), self::STEPS) >= array_search($run_until_step, self::STEPS)) {
|
if ( array_search( $state->get_last_step_name(), self::STEPS ) >= array_search( $run_until_step,
|
||||||
|
self::STEPS ) ) {
|
||||||
throw new Installer_Error( Installer_Error_Codes::REQUESTED_STEP_ALREADY_RUN );
|
throw new Installer_Error( Installer_Error_Codes::REQUESTED_STEP_ALREADY_RUN );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,16 +123,12 @@ class WC_WCCOM_Site_Installation_Manager {
|
||||||
$class_name = "WC_WCCOM_Site_Installation_Step_$step_name";
|
$class_name = "WC_WCCOM_Site_Installation_Step_$step_name";
|
||||||
$current_step = new $class_name( $state );
|
$current_step = new $class_name( $state );
|
||||||
$current_step->run();
|
$current_step->run();
|
||||||
|
|
||||||
} catch ( Installer_Error $exception ) {
|
} catch ( Installer_Error $exception ) {
|
||||||
|
|
||||||
$state->capture_failure( $step_name, $exception->get_error_code() );
|
$state->capture_failure( $step_name, $exception->get_error_code() );
|
||||||
WC_WCCOM_Site_Installation_State_Storage::save_state( $state );
|
WC_WCCOM_Site_Installation_State_Storage::save_state( $state );
|
||||||
|
|
||||||
throw $exception;
|
throw $exception;
|
||||||
|
|
||||||
} catch ( Throwable $error ) {
|
} catch ( Throwable $error ) {
|
||||||
|
|
||||||
$state->capture_failure( $step_name, Installer_Error_Codes::UNEXPECTED_ERROR );
|
$state->capture_failure( $step_name, Installer_Error_Codes::UNEXPECTED_ERROR );
|
||||||
WC_WCCOM_Site_Installation_State_Storage::save_state( $state );
|
WC_WCCOM_Site_Installation_State_Storage::save_state( $state );
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* State storage for the WCCOM Site installation process.
|
||||||
|
*
|
||||||
|
* @package WooCommerce\WCCOM\Installation
|
||||||
|
*/
|
||||||
|
|
||||||
defined( 'ABSPATH' ) || exit;
|
defined( 'ABSPATH' ) || exit;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* State for the WCCOM Site installation process.
|
||||||
|
*
|
||||||
|
* @package WooCommerce\WCCOM\Installation
|
||||||
|
*/
|
||||||
|
|
||||||
defined( 'ABSPATH' ) || exit;
|
defined( 'ABSPATH' ) || exit;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Activate product step.
|
||||||
|
*
|
||||||
|
* @package WooCommerce\WCCOM\Installation\Installation_Steps
|
||||||
|
*/
|
||||||
|
|
||||||
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
||||||
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Download product step.
|
||||||
|
*
|
||||||
|
* @package WooCommerce\WCCOM\Installation\Installation_Steps
|
||||||
|
*/
|
||||||
|
|
||||||
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
||||||
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Get product info step.
|
||||||
|
*
|
||||||
|
* @package WooCommerce\WCCOM\Installation\Installation_Steps
|
||||||
|
*/
|
||||||
|
|
||||||
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
||||||
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
||||||
|
@ -9,8 +14,8 @@ class WC_WCCOM_Site_Installation_Step_Get_Product_Info implements WC_WCCOM_Site_
|
||||||
public function __construct( $state ) {
|
public function __construct( $state ) {
|
||||||
$this->state = $state;
|
$this->state = $state;
|
||||||
}
|
}
|
||||||
public function run() {
|
|
||||||
|
|
||||||
|
public function run() {
|
||||||
$product_id = $this->state->get_product_id();
|
$product_id = $this->state->get_product_id();
|
||||||
|
|
||||||
// Get product info from woocommerce.com.
|
// Get product info from woocommerce.com.
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Move product to the correct location.
|
||||||
|
*
|
||||||
|
* @package @package WooCommerce\WCCOM\Installation\Installation_Steps
|
||||||
|
*/
|
||||||
|
|
||||||
defined( 'ABSPATH' ) || exit;
|
defined( 'ABSPATH' ) || exit;
|
||||||
|
|
||||||
|
@ -35,10 +40,12 @@ class WC_WCCOM_Site_Installation_Step_Move_Product implements WC_WCCOM_Site_Inst
|
||||||
|
|
||||||
$this->state->set_installed_path( $existing_folder_path );
|
$this->state->set_installed_path( $existing_folder_path );
|
||||||
$this->state->set_already_installed_plugin_info( $plugin_info );
|
$this->state->set_already_installed_plugin_info( $plugin_info );
|
||||||
|
|
||||||
return $this->state;
|
return $this->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->state->set_installed_path( $result['destination'] );
|
$this->state->set_installed_path( $result['destination'] );
|
||||||
|
|
||||||
return $this->state;
|
return $this->state;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Get product info step.
|
||||||
|
*
|
||||||
|
* @package WooCommerce\WCCOM\Installation\Installation_Steps
|
||||||
|
*/
|
||||||
|
|
||||||
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
use WC_REST_WCCOM_Site_Installer_Error_Codes as Installer_Error_Codes;
|
||||||
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
use WC_REST_WCCOM_Site_Installer_Error as Installer_Error;
|
||||||
|
@ -21,6 +26,5 @@ class WC_WCCOM_Site_Installation_Step_Unpack_Product implements WC_WCCOM_Site_In
|
||||||
$this->state->set_unpacked_path( $unpacked_path );
|
$this->state->set_unpacked_path( $unpacked_path );
|
||||||
|
|
||||||
return $this->state;
|
return $this->state;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Interface for installation steps.
|
||||||
|
*
|
||||||
|
* @package WooCommerce\WCCOM\Installation\Installation_Steps
|
||||||
|
*/
|
||||||
|
|
||||||
defined( 'ABSPATH' ) || exit;
|
defined( 'ABSPATH' ) || exit;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue