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