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,