Skip to content
Snippets Groups Projects
Commit 50015c8c authored by Art4's avatar Art4
Browse files

CS var names in camelCase

parent 3f3819a6
Branches 8.5
No related merge requests found
......@@ -16,12 +16,12 @@ if (file_exists($composerPath)) {
*/
spl_autoload_register(function ($class) {
// project-specific namespace prefix and base directory with trailing /
$namespace_map = [
$namespaceMap = [
'Redmine\\' => __DIR__.'/Redmine/',
'Redmine\\Tests\\' => __DIR__.'/../tests/',
];
foreach ($namespace_map as $prefix => $base_dir) {
foreach ($namespaceMap as $prefix => $baseDir) {
// does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
......@@ -30,12 +30,12 @@ spl_autoload_register(function ($class) {
}
// get the relative class name
$relative_class = substr($class, $len);
$relativeClass = substr($class, $len);
// replace the namespace prefix with the base directory, replace namespace
// separators with directory separators in the relative class name, append
// with .php
$file = $base_dir.str_replace('\\', '/', $relative_class).'.php';
$file = $baseDir.str_replace('\\', '/', $relativeClass).'.php';
// if the file exists, require it
if (file_exists($file)) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment