Completed
Pull Request — master (#25)
by None
10:40 queued 08:46
created
SemanticFormsSelect.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -6,42 +6,42 @@  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 ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
14
-	require_once( __DIR__ . '/vendor/autoload.php' );
13
+if (file_exists(__DIR__ . '/vendor/autoload.php')) {
14
+	require_once(__DIR__ . '/vendor/autoload.php');
15 15
 }
16 16
 
17
-if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.23', 'lt' ) ) {
18
-	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.' );
17
+if (version_compare($GLOBALS['wgVersion'], '1.23', 'lt')) {
18
+	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.');
19 19
 }
20 20
 
21 21
 $GLOBALS['wgExtensionFunctions'][] = function() {
22
-	if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.26c', '<' ) ) {
23
-		if ( version_compare( SF_VERSION, '2.8', '<' ) ) {
24
-			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
+	if (version_compare($GLOBALS['wgVersion'], '1.26c', '<')) {
23
+		if (version_compare(SF_VERSION, '2.8', '<')) {
24
+			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.');
25 25
 		}
26 26
 	}
27 27
 };
28 28
 
29 29
 // Do not initialize more than once.
30
-if ( defined( 'SFS_VERSION' ) ) {
30
+if (defined('SFS_VERSION')) {
31 31
 	return 1;
32 32
 }
33 33
 
34
-define( 'SFS_VERSION', '1.3.0' );
34
+define('SFS_VERSION', '1.3.0');
35 35
 
36 36
 /**
37 37
  * @codeCoverageIgnore
38 38
  */
39
-call_user_func( function() {
39
+call_user_func(function() {
40 40
 
41 41
 	$GLOBALS['wgExtensionCredits']['semantic'][] = array(
42 42
 		'path' => __FILE__,
43 43
 		'name' => 'Semantic Forms Select',
44
-		'author' =>array( 'Jason Zhang', 'Toni Hermoso Pulido', '...' ),
44
+		'author' =>array('Jason Zhang', 'Toni Hermoso Pulido', '...'),
45 45
 		'url' => 'https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect',
46 46
 		'description' => 'Allows to generate a select field in a semantic form whose values are retrieved from a query',
47 47
 		'version'  => SFS_VERSION,
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
 	$GLOBALS['wgSF_Select_debug'] = 0;
56 56
 
57 57
 	// Register resource files
58
-	$extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 );
58
+	$extensionPathParts = explode(DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2);
59 59
 
60 60
 	$GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array(
61
-		'localBasePath' => __DIR__ ,
62
-		'remoteExtPath' => end( $extensionPathParts ),
61
+		'localBasePath' => __DIR__,
62
+		'remoteExtPath' => end($extensionPathParts),
63 63
 		'position' => 'bottom',
64
-		'scripts' => array( 'res/scriptSelect.js' ),
64
+		'scripts' => array('res/scriptSelect.js'),
65 65
 		'dependencies' => array(
66 66
 			'ext.semanticforms.main'
67 67
 		)
68 68
 	);
69 69
 
70 70
 	$GLOBALS['wgExtensionFunctions'][] = function() {
71
-		$GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() );
71
+		$GLOBALS['sfgFormPrinter']->setInputTypeHook('SF_Select', '\SFS\SemanticFormsSelect::init', array());
72 72
 	};
73 73
 
74 74
 } );
Please login to merge, or discard this patch.