Skip to content

Commit a36d6e7

Browse files
authored
Merge pull request #9 from codeigniter4/rector-namespace
Namespacing Helpers
2 parents bf3a4c0 + a7db1c8 commit a36d6e7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Template/rector.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151
__DIR__ . '/tests/',
5252
]);
5353

54+
// Include Composer's autoload - required for global execution, remove if running locally
55+
$parameters->set(Option::AUTOLOAD_PATHS, [
56+
__DIR__ . '/vendor/autoload.php',
57+
]);
58+
5459
// Do you need to include constants, class aliases, or a custom autoloader?
5560
$parameters->set(Option::BOOTSTRAP_FILES, [
5661
realpath(getcwd()) . '/vendor/codeigniter4/framework/system/Test/bootstrap.php',
@@ -77,6 +82,11 @@
7782
__DIR__ . '/tests',
7883
],
7984

85+
// Ignore files that should not be namespaced
86+
NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [
87+
__DIR__ . '/app/Helpers',
88+
],
89+
8090
// May load view files directly when detecting classes
8191
StringClassNameToClassConstantRector::class,
8292

0 commit comments

Comments
 (0)