Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
57 | public static function onMakeGlobalVariablesScript( array &$vars ) { |
||
|
|||
58 | $vars['egMapsScriptPath'] = $GLOBALS['wgScriptPath'] . '/extensions/Maps/'; // TODO: wgExtensionDirectory? |
||
59 | $vars['egMapsDebugJS'] = $GLOBALS['egMapsDebugJS']; |
||
60 | $vars['egMapsAvailableServices'] = $GLOBALS['egMapsAvailableServices']; |
||
61 | $vars['egMapsLeafletLayersApiKeys'] = $GLOBALS['egMapsLeafletLayersApiKeys']; |
||
62 | |||
63 | $vars += $GLOBALS['egMapsGlobalJSVars']; |
||
64 | |||
65 | return true; |
||
66 | } |
||
67 | |||
69 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: