Completed
Push — master ( 78608a...88ccec )
by mw
01:26
created
SemanticCompoundQueries.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	public static function load() {
24 24
 
25
-		if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
25
+		if (is_readable(__DIR__ . '/vendor/autoload.php')) {
26 26
 			include_once __DIR__ . '/vendor/autoload.php';
27 27
 		}
28 28
 	}
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 	/**
31 31
 	 * @since 1.1
32 32
 	 */
33
-	public static function initExtension( $credits = [] ) {
33
+	public static function initExtension($credits = []) {
34 34
 
35 35
 		// See https://phabricator.wikimedia.org/T151136
36
-		define( 'SCQ_VERSION', isset( $credits['version'] ) ? $credits['version'] : 'UNKNOWN' );
36
+		define('SCQ_VERSION', isset($credits['version']) ? $credits['version'] : 'UNKNOWN');
37 37
 
38 38
 		// Register message files
39 39
 		$GLOBALS['wgMessagesDirs']['SemanticCompoundQueries'] = __DIR__ . '/i18n';
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public static function onExtensionFunction() {
48 48
 
49
-		if ( !defined( 'SMW_VERSION' ) ) {
49
+		if (!defined('SMW_VERSION')) {
50 50
 
51
-			if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ) {
52
-				die( "\nThe 'Semantic Compound Queries' extension requires 'Semantic MediaWiki' to be installed and enabled.\n" );
51
+			if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
52
+				die("\nThe 'Semantic Compound Queries' extension requires 'Semantic MediaWiki' to be installed and enabled.\n");
53 53
 			} else {
54 54
 				die(
55 55
 					'<b>Error:</b> The <a href="https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Compound_Queries">Semantic Compound Queries</a> ' .
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 		$GLOBALS['wgAPIModules']['compoundquery'] = 'SCQ\Api\CompoundQuery';
64 64
 
65 65
 		// wgHooks
66
-		$GLOBALS['wgHooks']['ParserFirstCallInit'][] = function( Parser &$parser  ) {
67
-			$parser->setFunctionHook( 'compound_query', [ '\SCQ\CompoundQueryProcessor', 'doCompoundQuery' ] );
66
+		$GLOBALS['wgHooks']['ParserFirstCallInit'][] = function(Parser &$parser) {
67
+			$parser->setFunctionHook('compound_query', ['\SCQ\CompoundQueryProcessor', 'doCompoundQuery']);
68 68
 
69 69
 			// always return true, in order not to stop MW's hook processing!
70 70
 			return true;
Please login to merge, or discard this patch.