Skip to content

Commit

Permalink
Feat: Change reserved keyword resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuj-Rathore24 committed Jul 19, 2024
1 parent 553450b commit 8c1ff11
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions inc/helpers/autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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' );

0 comments on commit 8c1ff11

Please sign in to comment.