@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | /** |
14 | 14 | * @since 1.0 |
15 | 15 | */ |
16 | - public static function initExtension( $credits = array() ) { |
|
16 | + public static function initExtension($credits = array()) { |
|
17 | 17 | |
18 | 18 | // See https://phabricator.wikimedia.org/T151136 (extension.json) |
19 | - define( 'SFS_VERSION', isset( $credits['version'] ) ? $credits['version'] : '2.2.0-alpha' ); |
|
19 | + define('SFS_VERSION', isset($credits['version']) ? $credits['version'] : '2.2.0-alpha'); |
|
20 | 20 | |
21 | 21 | // Api modules |
22 | 22 | $GLOBALS['wgAPIModules']['sformsselect'] = 'SFS\ApiSemanticFormsSelect'; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | // Register resource files |
28 | 28 | $GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array( |
29 | - 'localBasePath' => __DIR__ , |
|
29 | + 'localBasePath' => __DIR__, |
|
30 | 30 | 'remoteExtPath' => 'SemanticFormsSelect', |
31 | 31 | 'position' => 'bottom', |
32 | 32 | 'scripts' => array( |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public static function onExtensionFunction() { |
45 | 45 | |
46 | - if ( !defined( 'PF_VERSION' ) ) { |
|
47 | - die( '<b>Error:</b><a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">Semantic Forms Select</a> requires the <a href="https://www.mediawiki.org/wiki/Extension:PageForms">Page Forms</a> extension. Please install and activate this extension first.' ); |
|
46 | + if (!defined('PF_VERSION')) { |
|
47 | + die('<b>Error:</b><a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">Semantic Forms Select</a> requires the <a href="https://www.mediawiki.org/wiki/Extension:PageForms">Page Forms</a> extension. Please install and activate this extension first.'); |
|
48 | 48 | } |
49 | 49 | |
50 | - if ( isset( $GLOBALS['wgPageFormsFormPrinter'] )) { |
|
51 | - $GLOBALS['wgPageFormsFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() ); |
|
50 | + if (isset($GLOBALS['wgPageFormsFormPrinter'])) { |
|
51 | + $GLOBALS['wgPageFormsFormPrinter']->setInputTypeHook('SF_Select', '\SFS\SemanticFormsSelect::init', array()); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @return string|null |
61 | 61 | */ |
62 | - public static function getVersion( $dependency = null ) { |
|
62 | + public static function getVersion($dependency = null) { |
|
63 | 63 | |
64 | - if ( $dependency === null && defined( 'SFS_VERSION' ) ) { |
|
64 | + if ($dependency === null && defined('SFS_VERSION')) { |
|
65 | 65 | return SFS_VERSION; |
66 | 66 | } |
67 | 67 | |
68 | - if ( $dependency === 'PageForms' && defined( 'PF_VERSION' ) ) { |
|
68 | + if ($dependency === 'PageForms' && defined('PF_VERSION')) { |
|
69 | 69 | return PF_VERSION; |
70 | 70 | } |
71 | 71 |