refactor: remove namespace from language files#619
refactor: remove namespace from language files#619kenjis merged 2 commits intocodeigniter4:developfrom
namespace from language files#619Conversation
|
The Rector rule |
|
@jozefrebjak As you know, CI4 heavily uses the namespace. On the other hand, completely eliminating class I don't understand why you want to not use namespace in app/Config. Anyway you can do as I did. |
|
@samsonasik Thank you for your quick review. Kenjis, I prefer to merge after codeigniter4/CodeIgniter4#7210. |
By default is for example namespace Config;after enabling that rule as it's provided in devkit is rector trying to change it to: namespace App/Config;and it ends with error: Fatal error: Uncaught TypeError: CodeIgniter\CodeIgniter::__construct(): Argument #1 ($config) must be of type Config\App, App\Config\App given, called in /app/vendor/codeigniter4/framework/system/Config/Services.php on line 150 and defined in /app/vendor/codeigniter4/framework/system/CodeIgniter.php:170 I know how to namespace and I was lazy so I decided to remove that rule till I find a solutions. |
|
@datamweb Oh, I checked the latest project which I am working on and I already did it in the past :D So sorry about my comment here. // Ignore files that should not be namespaced to their folder
NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [
__DIR__ . '/app/Common.php',
__DIR__ . '/app/Config',
__DIR__ . '/app/Language',
__DIR__ . '/app/Helpers',
__DIR__ . '/tests/_support',
], |
No problem, I'm glad you're here. |
CI4 is built for PHP 7.4+, and everything in the framework is namespaced,
except for the helper and lang files.
see codeigniter4/CodeIgniter4#7210