Completed
Pull Request — master (#20)
by None
583:15 queued 570:37
created
src/SemanticFormsSelect.hooks.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,19 +4,19 @@
 block discarded – undo
4 4
 
5 5
 	public static onCallback() {
6 6
 		// Do not initialize more than once.
7
-		if ( defined( 'SFS_VERSION' ) ) {
7
+		if (defined('SFS_VERSION')) {
8 8
 			return 1;
9 9
 		}
10 10
 
11
-		define( 'SFS_VERSION', '1.3.0' );
11
+		define('SFS_VERSION', '1.3.0');
12 12
 
13
-		if ( !\ExtensionRegistry::getInstance()->isLoaded( 'SemanticForms' ) ) {
14
-			die( '<b>Error:</b> <a href="https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect">Semantic Forms Selects</a> is a Semantic Forms extension. You need to install <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' );
13
+		if (!\ExtensionRegistry::getInstance()->isLoaded('SemanticForms')) {
14
+			die('<b>Error:</b> <a href="https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect">Semantic Forms Selects</a> is a Semantic Forms extension. You need to install <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.');
15 15
 		}
16 16
 	}
17 17
 
18 18
 	public static onExtensiionFunction() {
19
-		$GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() );
19
+		$GLOBALS['sfgFormPrinter']->setInputTypeHook('SF_Select', '\SFS\SemanticFormsSelect::init', array());
20 20
 	}
21 21
 
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
SemanticFormsSelect.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,35 +7,35 @@  discard block
 block discarded – undo
7 7
  * @defgroup SFS SemanticFormsSelect
8 8
  */
9 9
 
10
-if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.23c', 'lt' ) ) {
11
-	die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with MediaWiki 1.23 or above. You need to upgrade MediaWiki first.' );
10
+if (version_compare($GLOBALS['wgVersion'], '1.23c', 'lt')) {
11
+	die('<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with MediaWiki 1.23 or above. You need to upgrade MediaWiki first.');
12 12
 }
13 13
 
14
-if ( isset( $wgWikimediaTravisCI ) && $wgWikimediaTravisCI == true ) {
15
-	if ( is_readable( __DIR__ . '/../../vendor/autoload.php' ) ) {
14
+if (isset($wgWikimediaTravisCI) && $wgWikimediaTravisCI == true) {
15
+	if (is_readable(__DIR__ . '/../../vendor/autoload.php')) {
16 16
 		require_once __DIR__ . '/../../vendor/autoload.php';
17 17
 	}
18
-} elseif ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
18
+} elseif (is_readable(__DIR__ . '/vendor/autoload.php')) {
19 19
 	require_once __DIR__ . '/vendor/autoload.php';
20 20
 }
21 21
 
22 22
 $GLOBALS['wgExtensionFunctions'][] = function() {
23
-	if ( version_compare( $GLOBALS['wgVersion'], '1.27c', '>' ) ) {
24
-		if ( !ExtensionRegistry::getInstance()->isLoaded( 'SemanticForms' ) ) {
25
-			die( '<b>Error:</b> <a href="https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect">Semantic Forms Selects</a> is a Semantic Forms extension. You need to install <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' );
23
+	if (version_compare($GLOBALS['wgVersion'], '1.27c', '>')) {
24
+		if (!ExtensionRegistry::getInstance()->isLoaded('SemanticForms')) {
25
+			die('<b>Error:</b> <a href="https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect">Semantic Forms Selects</a> is a Semantic Forms extension. You need to install <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.');
26 26
 		}
27 27
 	}
28 28
 };
29 29
 
30 30
 // Do not initialize more than once.
31
-if ( defined( 'SFS_VERSION' ) ) {
31
+if (defined('SFS_VERSION')) {
32 32
 	return 1;
33 33
 }
34 34
 
35
-define( 'SFS_VERSION', '1.3.0' );
35
+define('SFS_VERSION', '1.3.0');
36 36
 
37
-if ( function_exists( 'wfLoadExtension' ) ) {
38
-	wfLoadExtension( 'SemanticFormsSelect' );
37
+if (function_exists('wfLoadExtension')) {
38
+	wfLoadExtension('SemanticFormsSelect');
39 39
 	// Keep i18n globals so mergeMessageFileList.php doesn't break
40 40
 	$GLOBALS['wgMessagesDirs']['SemanticFormsSelect'] = __DIR__ . '/i18n';
41 41
 	/* wfWarn(
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 /**
49 49
  * @codeCoverageIgnore
50 50
  */
51
-call_user_func( function() {
51
+call_user_func(function() {
52 52
 
53 53
 	$GLOBALS['wgExtensionCredits']['semantic'][] = array(
54 54
 		'path' => __FILE__,
55 55
 		'name' => 'Semantic Forms Select',
56
-		'author' =>array( 'Jason Zhang', 'Toni Hermoso Pulido', '...' ),
56
+		'author' =>array('Jason Zhang', 'Toni Hermoso Pulido', '...'),
57 57
 		'url' => 'https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect',
58 58
 		'descriptionmsg' => 'semanticformsselect-desc',
59 59
 		'version'  => SFS_VERSION,
@@ -69,20 +69,20 @@  discard block
 block discarded – undo
69 69
 	$GLOBALS['wgSF_Select_debug'] = 0;
70 70
 
71 71
 	// Register resource files
72
-	$extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 );
72
+	$extensionPathParts = explode(DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2);
73 73
 
74 74
 	$GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array(
75
-		'localBasePath' => __DIR__ ,
76
-		'remoteExtPath' => end( $extensionPathParts ),
75
+		'localBasePath' => __DIR__,
76
+		'remoteExtPath' => end($extensionPathParts),
77 77
 		'position' => 'bottom',
78
-		'scripts' => array( 'res/scriptSelect.js' ),
78
+		'scripts' => array('res/scriptSelect.js'),
79 79
 		'dependencies' => array(
80 80
 			'ext.semanticforms.main'
81 81
 		)
82 82
 	);
83 83
 
84 84
 	$GLOBALS['wgExtensionFunctions'][] = function() {
85
-		$GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() );
85
+		$GLOBALS['sfgFormPrinter']->setInputTypeHook('SF_Select', '\SFS\SemanticFormsSelect::init', array());
86 86
 	};
87 87
 
88 88
 } );
Please login to merge, or discard this patch.