Completed
Push — master ( 2a4fe5...e752fc )
by mw
02:40
created
SemanticFormsSelect.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.