Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function i18nFileProvider() { |
||
|
|||
37 | |||
38 | $provider = array(); |
||
39 | $location = $GLOBALS['wgMessagesDirs']['SemanticExternalQueryLookup']; |
||
40 | |||
41 | $bulkFileProvider = UtilityFactory::getInstance()->newBulkFileProvider( $location ); |
||
42 | $bulkFileProvider->searchByFileExtension( 'json' ); |
||
43 | |||
44 | foreach ( $bulkFileProvider->getFiles() as $file ) { |
||
45 | $provider[] = array( $file ); |
||
46 | } |
||
47 | |||
48 | return $provider; |
||
49 | } |
||
50 | |||
52 |
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: