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