| Conditions | 11 |
| Paths | 61 |
| Total Lines | 45 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 16 | public static function getLoader() |
||
| 17 | { |
||
| 18 | if (null !== self::$loader) { |
||
| 19 | return self::$loader; |
||
| 20 | } |
||
| 21 | |||
| 22 | spl_autoload_register(array('ComposerAutoloaderInite8a68ecb55b8fe188f6e27a78211fc4d', 'loadClassLoader'), true, true); |
||
| 23 | self::$loader = $loader = new \Composer\Autoload\ClassLoader(); |
||
| 24 | spl_autoload_unregister(array('ComposerAutoloaderInite8a68ecb55b8fe188f6e27a78211fc4d', 'loadClassLoader')); |
||
| 25 | |||
| 26 | $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); |
||
| 27 | if ($useStaticLoader) { |
||
| 28 | require_once __DIR__ . '/autoload_static.php'; |
||
| 29 | |||
| 30 | call_user_func(\Composer\Autoload\ComposerStaticInite8a68ecb55b8fe188f6e27a78211fc4d::getInitializer($loader)); |
||
| 31 | } else { |
||
| 32 | $map = require __DIR__ . '/autoload_namespaces.php'; |
||
| 33 | foreach ($map as $namespace => $path) { |
||
| 34 | $loader->set($namespace, $path); |
||
| 35 | } |
||
| 36 | |||
| 37 | $map = require __DIR__ . '/autoload_psr4.php'; |
||
| 38 | foreach ($map as $namespace => $path) { |
||
| 39 | $loader->setPsr4($namespace, $path); |
||
| 40 | } |
||
| 41 | |||
| 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; |
||
| 43 | if ($classMap) { |
||
| 44 | $loader->addClassMap($classMap); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | $loader->register(true); |
||
| 49 | |||
| 50 | if ($useStaticLoader) { |
||
| 51 | $includeFiles = Composer\Autoload\ComposerStaticInite8a68ecb55b8fe188f6e27a78211fc4d::$files; |
||
| 52 | } else { |
||
| 53 | $includeFiles = require __DIR__ . '/autoload_files.php'; |
||
| 54 | } |
||
| 55 | foreach ($includeFiles as $fileIdentifier => $file) { |
||
| 56 | composerRequiree8a68ecb55b8fe188f6e27a78211fc4d($fileIdentifier, $file); |
||
| 57 | } |
||
| 58 | |||
| 59 | return $loader; |
||
| 60 | } |
||
| 61 | } |
||
| 71 |