Completed
Pull Request — master (#23)
by None
34:49 queued 31:52
created
SemanticFormsSelect.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -6,37 +6,37 @@  discard block
 block discarded – undo
6 6
  *
7 7
  * @defgroup SFS SemanticFormsSelect
8 8
  */
9
-if ( !defined( 'MEDIAWIKI' ) ) {
10
-	die( 'This file is part of the SemanticFormsSelect extension, it is not a valid entry point.' );
9
+if (!defined('MEDIAWIKI')) {
10
+	die('This file is part of the SemanticFormsSelect extension, it is not a valid entry point.');
11 11
 }
12 12
 
13
-if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.23c', '<' ) ) {
14
-	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.' );
13
+if (version_compare($GLOBALS['wgVersion'], '1.23c', '<')) {
14
+	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.');
15 15
 }
16
-if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.26c', '>' ) ) {
17
-	if ( !ExtensionRegistry::getInstance()->isLoaded( 'SemanticForms' ) ) {
18
-		die( '<b>Error:</b> You need to install <a href="https://www.mediawiki.org/wiki/Extension:SemanticForms">SemanticForms</a> first.' );
16
+if (version_compare($GLOBALS['wgVersion'], '1.26c', '>')) {
17
+	if (!ExtensionRegistry::getInstance()->isLoaded('SemanticForms')) {
18
+		die('<b>Error:</b> You need to install <a href="https://www.mediawiki.org/wiki/Extension:SemanticForms">SemanticForms</a> first.');
19 19
 	}
20
-} elseif ( version_compare( 'SF_VERSION', '2.8', '<' ) ) {
21
-	die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with Semantic Forms 2.8 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' );
20
+} elseif (version_compare('SF_VERSION', '2.8', '<')) {
21
+	die('<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with Semantic Forms 2.8 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.');
22 22
 }
23 23
 
24 24
 // Do not initialize more than once.
25
-if ( defined( 'SFS_VERSION' ) ) {
25
+if (defined('SFS_VERSION')) {
26 26
 	return 1;
27 27
 }
28 28
 
29
-define( 'SFS_VERSION', '1.3.0' );
29
+define('SFS_VERSION', '1.3.0');
30 30
 
31 31
 /**
32 32
  * @codeCoverageIgnore
33 33
  */
34
-call_user_func( function() {
34
+call_user_func(function() {
35 35
 
36 36
 	$GLOBALS['wgExtensionCredits']['semantic'][] = array(
37 37
 		'path' => __FILE__,
38 38
 		'name' => 'Semantic Forms Select',
39
-		'author' =>array( 'Jason Zhang', 'Toni Hermoso Pulido', '...' ),
39
+		'author' =>array('Jason Zhang', 'Toni Hermoso Pulido', '...'),
40 40
 		'url' => 'https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect',
41 41
 		'description' => 'Allows to generate a select field in a semantic form whose values are retrieved from a query',
42 42
 		'version'  => SFS_VERSION,
@@ -50,20 +50,20 @@  discard block
 block discarded – undo
50 50
 	$GLOBALS['wgSF_Select_debug'] = 0;
51 51
 
52 52
 	// Register resource files
53
-	$extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 );
53
+	$extensionPathParts = explode(DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2);
54 54
 
55 55
 	$GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array(
56
-		'localBasePath' => __DIR__ ,
57
-		'remoteExtPath' => end( $extensionPathParts ),
56
+		'localBasePath' => __DIR__,
57
+		'remoteExtPath' => end($extensionPathParts),
58 58
 		'position' => 'bottom',
59
-		'scripts' => array( 'res/scriptSelect.js' ),
59
+		'scripts' => array('res/scriptSelect.js'),
60 60
 		'dependencies' => array(
61 61
 			'ext.semanticforms.main'
62 62
 		)
63 63
 	);
64 64
 
65 65
 	$GLOBALS['wgExtensionFunctions'][] = function() {
66
-		$GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() );
66
+		$GLOBALS['sfgFormPrinter']->setInputTypeHook('SF_Select', '\SFS\SemanticFormsSelect::init', array());
67 67
 	};
68 68
 
69 69
 } );
Please login to merge, or discard this patch.