Conditions | 11 |
Paths | 61 |
Total Lines | 44 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
19 | public static function getLoader() |
||
20 | { |
||
21 | if (null !== self::$loader) { |
||
22 | return self::$loader; |
||
23 | } |
||
24 | |||
25 | require __DIR__ . '/platform_check.php'; |
||
26 | |||
27 | spl_autoload_register(array('ComposerAutoloaderInit912ef365a6588e1102f28f1b2c039019', 'loadClassLoader'), true, true); |
||
28 | self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); |
||
29 | spl_autoload_unregister(array('ComposerAutoloaderInit912ef365a6588e1102f28f1b2c039019', 'loadClassLoader')); |
||
30 | |||
31 | require __DIR__ . '/autoload_static.php'; |
||
32 | call_user_func(\Composer\Autoload\ComposerStaticInit912ef365a6588e1102f28f1b2c039019::getInitializer($loader)); |
||
33 | |||
34 | $loader->register(true); |
||
35 | |||
36 | $filesToLoad = \Composer\Autoload\ComposerStaticInit912ef365a6588e1102f28f1b2c039019::$files; |
||
37 | $requireFile = static function ($fileIdentifier, $file) { |
||
38 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { |
||
39 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; |
||
40 | |||
41 | require $file; |
||
42 | } |
||
43 | }; |
||
44 | foreach ($filesToLoad as $fileIdentifier => $file) { |
||
45 | ($requireFile)($fileIdentifier, $file); |
||
46 | } |
||
47 | |||
48 | return $loader; |
||
49 | } |
||
50 | } |
||
51 |