From 8c1ff11a9a386e97ca48c559a1d8e7fb2c1934b3 Mon Sep 17 00:00:00 2001 From: Anuj-Rathore24 Date: Fri, 19 Jul 2024 17:52:54 +0530 Subject: [PATCH] Feat: Change reserved keyword resource --- inc/helpers/autoloader.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/inc/helpers/autoloader.php b/inc/helpers/autoloader.php index 6d2f0f4..91f6ce4 100644 --- a/inc/helpers/autoloader.php +++ b/inc/helpers/autoloader.php @@ -10,15 +10,15 @@ /** * Auto loader function. * - * @param string $resource Source namespace. + * @param string $resource_path Source namespace. * * @return void */ -function autoloader( $resource = '' ) { +function autoloader( $resource_path = '' ) { $resource_path = false; $namespace_root = 'RT\Search_With_Google\\'; - $resource = trim( $resource, '\\' ); + $resource = trim( $resource_path, '\\' ); if ( empty( $resource ) || strpos( $resource, '\\' ) === false || strpos( $resource, $namespace_root ) !== 0 ) { // Not our namespace, bail out. @@ -80,7 +80,6 @@ function autoloader( $resource = '' ) { // We are already making sure that the file exists and it's valid. require_once( $resource_path ); // phpcs:ignore } - } spl_autoload_register( '\RT\Search_With_Google\Inc\Helpers\autoloader' );