Merge pull request #16516 from Umangvaghela/issue-16515

update Yoda condition
This commit is contained in:
Mike Jolley 2017-08-18 15:06:44 +01:00 committed by GitHub
commit c22fb01903
1 changed files with 8 additions and 8 deletions

View File

@ -73,21 +73,21 @@ class WC_Autoloader {
$file = $this->get_file_name_from_class( $class );
$path = '';
if ( strpos( $class, 'wc_addons_gateway_' ) === 0 ) {
if ( 0 === strpos( $class, 'wc_addons_gateway_' ) ) {
$path = $this->include_path . 'gateways/' . substr( str_replace( '_', '-', $class ), 18 ) . '/';
} elseif ( strpos( $class, 'wc_gateway_' ) === 0 ) {
} elseif ( 0 === strpos( $class, 'wc_gateway_' ) ) {
$path = $this->include_path . 'gateways/' . substr( str_replace( '_', '-', $class ), 11 ) . '/';
} elseif ( strpos( $class, 'wc_shipping_' ) === 0 ) {
} elseif ( 0 === strpos( $class, 'wc_shipping_' ) ) {
$path = $this->include_path . 'shipping/' . substr( str_replace( '_', '-', $class ), 12 ) . '/';
} elseif ( strpos( $class, 'wc_shortcode_' ) === 0 ) {
} elseif ( 0 === strpos( $class, 'wc_shortcode_' ) ) {
$path = $this->include_path . 'shortcodes/';
} elseif ( strpos( $class, 'wc_meta_box' ) === 0 ) {
} elseif ( 0 === strpos( $class, 'wc_meta_box' ) ) {
$path = $this->include_path . 'admin/meta-boxes/';
} elseif ( strpos( $class, 'wc_admin' ) === 0 ) {
} elseif ( 0 === strpos( $class, 'wc_admin' ) ) {
$path = $this->include_path . 'admin/';
} elseif ( strpos( $class, 'wc_payment_token_' ) === 0 ) {
} elseif ( 0 === strpos( $class, 'wc_payment_token_' ) ) {
$path = $this->include_path . 'payment-tokens/';
} elseif ( strpos( $class, 'wc_log_handler_' ) === 0 ) {
} elseif ( 0 === strpos( $class, 'wc_log_handler_' ) ) {
$path = $this->include_path . 'log-handlers/';
}