[CodeFactor] Apply fixes to commit bca98c3

[ci skip] [skip ci]
This commit is contained in:
codefactor-io 2020-05-05 13:19:34 +00:00
parent bca98c3a1a
commit 0c562742f7
12 changed files with 60 additions and 57 deletions

View file

@ -25,16 +25,17 @@ if ( ! defined( 'MAINWP_CHILD_URL' ) ) {
}
function mainwp_child_autoload( $class_name ) {
if ( 0 !== strpos( $class_name, 'MainWP\Child' ) )
if ( 0 !== strpos( $class_name, 'MainWP\Child' ) ) {
return;
}
// trip the namespace prefix: MainWP\Child\ .
$class_name = substr( $class_name, 13 );
if ( 0 !== strpos( $class_name, 'MainWP_' ) ) {
return;
}
$autoload_dir = \trailingslashit( dirname( __FILE__ ) . '/class' );
$autoload_path = sprintf( '%sclass-%s.php', $autoload_dir, strtolower( str_replace( '_', '-', $class_name ) ) );