Skip to content

Commit e0f6842

Browse files
committed
PHP Mess Detector Avoid unused private methods such as '__autoload'.
even if not correct
1 parent 745b331 commit e0f6842

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

lib/Autoloader.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,13 @@ class Autoloader
1313
*/
1414
public function __construct()
1515
{
16-
spl_autoload_register(array($this, '__autoload'));
17-
}
18-
19-
/**
20-
* @param string $class
21-
*/
22-
private function __autoload($class)
23-
{
24-
$class = str_replace('\\', '/', $class); // revert path for old PHP on Linux
25-
$dir = str_replace('\\', '/', __DIR__);
26-
if (file_exists($dir . '/' . $class . '.php')) {
27-
/** @noinspection PhpIncludeInspection */
28-
require_once $dir . '/' . $class . '.php';
29-
}
16+
spl_autoload_register(function ($class) {
17+
$class = str_replace('\\', '/', $class); // revert path for old PHP on Linux
18+
$dir = str_replace('\\', '/', __DIR__);
19+
if (file_exists($dir . '/' . $class . '.php')) {
20+
/** @noinspection PhpIncludeInspection */
21+
require_once $dir . '/' . $class . '.php';
22+
}
23+
});
3024
}
3125
}

0 commit comments

Comments
 (0)