From a7db1c89eb03d48207562be1ff6625e60047979a Mon Sep 17 00:00:00 2001 From: MGatner Date: Mon, 24 Jan 2022 00:08:39 +0000 Subject: [PATCH] Exempt Helpers from namespacing --- src/Template/rector.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Template/rector.php b/src/Template/rector.php index 7f32161..03ceca6 100644 --- a/src/Template/rector.php +++ b/src/Template/rector.php @@ -51,6 +51,11 @@ __DIR__ . '/tests/', ]); + // Include Composer's autoload - required for global execution, remove if running locally + $parameters->set(Option::AUTOLOAD_PATHS, [ + __DIR__ . '/vendor/autoload.php', + ]); + // Do you need to include constants, class aliases, or a custom autoloader? $parameters->set(Option::BOOTSTRAP_FILES, [ realpath(getcwd()) . '/vendor/codeigniter4/framework/system/Test/bootstrap.php', @@ -77,6 +82,11 @@ __DIR__ . '/tests', ], + // Ignore files that should not be namespaced + NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [ + __DIR__ . '/app/Helpers', + ], + // May load view files directly when detecting classes StringClassNameToClassConstantRector::class,