SonarQube code smells resolve #33
continuous-integration/drone/push Build is passing Details

LoginModification
Alexis 2 years ago
parent 89a12c02cb
commit 2c84154d6e

@ -7,13 +7,13 @@ class Autoload
public static function charger() public static function charger()
{ {
if (null !== self::$instance) { if (null !== self::$instance) {
throw new RuntimeException(sprintf('%s is already started', __CLASS__)); throw RuntimeException(sprintf('%s is already started', __CLASS__));
} }
self::$instance = new self(); self::$instance = new self();
if (!spl_autoload_register(array(self::$instance, '_autoload'), false)) { if (!spl_autoload_register(array(self::$instance, 'autoloader'), false)) {
throw RuntimeException(sprintf('%s : Could not start the autoload', __CLASS__)); throw RuntimeException(sprintf('%s : Could not start the autoload', __CLASS__));
} }
} }
@ -22,7 +22,7 @@ class Autoload
{ {
if (null !== self::$instance) { if (null !== self::$instance) {
if(!spl_autoload_unregister(array(self::$instance, '_autoload'))) { if(!spl_autoload_unregister(array(self::$instance, 'autoloader'))) {
throw new RuntimeException('Could not stop the autoload'); throw new RuntimeException('Could not stop the autoload');
} }
@ -30,7 +30,7 @@ class Autoload
} }
} }
private static function _autoload($className) private static function autoloader($className)
{ {
$folder = "./"; $folder = "./";
$className = ltrim($className, '\\'); $className = ltrim($className, '\\');

Loading…
Cancel
Save