| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public static function addToAdminLinks( ALTree &$admin_links_tree ) { |
||
| 28 | $displaying_data_section = $admin_links_tree->getSection( |
||
| 29 | wfMessage( 'smw_adminlinks_displayingdata' )->text() |
||
| 30 | ); |
||
| 31 | |||
| 32 | // Escape if SMW hasn't added links. |
||
| 33 | if ( is_null( $displaying_data_section ) ) { |
||
| 34 | return true; |
||
| 35 | } |
||
| 36 | |||
| 37 | $smw_docu_row = $displaying_data_section->getRow( 'smw' ); |
||
| 38 | |||
| 39 | $maps_docu_label = wfMessage( 'adminlinks_documentation', 'Maps' )->text(); |
||
| 40 | $smw_docu_row->addItem( |
||
| 41 | AlItem::newFromExternalLink( 'https://www.semantic-mediawiki.org/wiki/Extension:Maps', $maps_docu_label ) |
||
| 42 | ); |
||
| 43 | |||
| 44 | return true; |
||
| 45 | } |
||
| 46 | |||
| 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: