Completed
Push — master ( dc1683...3e9aec )
by mw
07:38 queued 05:33
created
src/CompoundQueryProcessor.php 2 patches
Doc Comments   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 *
133 133
 	 * @param string $param
134 134
 	 *
135
-	 * @return array
135
+	 * @return string[]
136 136
 	 */
137 137
 	protected static function getSubParams( $param ) {
138 138
 		$sub_params = array();
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 * @param $context
169 169
 	 * @param $showmode
170 170
 	 *
171
-	 * @return SMWQueryResult
171
+	 * @return \SMWQueryResult
172 172
 	 */
173 173
 	protected static function getQueryResultFromFunctionParams( $rawparams, $context = QueryProcessor::INLINE_QUERY, $showmode = false ) {
174 174
 		$printouts = array();
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	 * Combine two arrays of SMWWikiPageValue objects into one
181 181
 	 *
182 182
 	 * @param array $result1
183
-	 * @param array $result2
183
+	 * @param \SMWDIWikiPage[] $result2
184 184
 	 *
185 185
 	 * @return array
186 186
 	 */
@@ -204,6 +204,9 @@  discard block
 block discarded – undo
204 204
 		return $result1;
205 205
 	}
206 206
 
207
+	/**
208
+	 * @param \SMW\Query\PrintRequest[] $printRequests2
209
+	 */
207 210
 	protected static function mergeSMWPrintRequests( $printRequests1, $printRequests2 ) {
208 211
 		$existingPrintoutLabels = array();
209 212
 		foreach ( $printRequests1 as $p1 ) {
@@ -220,13 +223,13 @@  discard block
 block discarded – undo
220 223
 	}
221 224
 
222 225
 	/**
223
-	 * @param $querystring
226
+	 * @param string $querystring
224 227
 	 * @param array $params
225 228
 	 * @param $extraPrintouts
226 229
 	 * @param $outputMode
227 230
 	 * @param $context
228 231
 	 *
229
-	 * @return SMWQueryResult
232
+	 * @return \SMWQueryResult
230 233
 	 */
231 234
 	protected static function getQueryResultFromQueryString( $querystring, array $params, $extraPrintouts, $context = QueryProcessor::INLINE_QUERY ) {
232 235
 
@@ -262,7 +265,7 @@  discard block
 block discarded – undo
262 265
 	 *
263 266
 	 * @param CompoundQueryResult $res
264 267
 	 * @param array $params These need to be the result of a list fed to getProcessedParams as of SMW 1.6.2
265
-	 * @param $outputmode
268
+	 * @param integer $outputmode
266 269
 	 * @param $context
267 270
 	 * @param string $format
268 271
 	 *
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
 	/**
22 22
 	 * Comparison helper function, used in sorting results.
23 23
 	 */
24
-	public static function compareQueryResults( $a, $b ) {
24
+	public static function compareQueryResults($a, $b) {
25 25
 
26
-		if ( $a->getSerialization() == $b->getSerialization() ) {
26
+		if ($a->getSerialization() == $b->getSerialization()) {
27 27
 			return 0;
28 28
 		}
29 29
 
30
-		return ( $a->getSerialization() < $b->getSerialization() ) ? -1 : 1;
30
+		return ($a->getSerialization() < $b->getSerialization()) ? -1 : 1;
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return string
39 39
 	 */
40
-	public static function doCompoundQuery( Parser &$parser ) {
40
+	public static function doCompoundQuery(Parser&$parser) {
41 41
 		global $smwgQEnabled, $smwgIQRunningNumber;
42 42
 
43
-		if ( !$smwgQEnabled ) {
44
-			return smwfEncodeMessages( array( wfMessage( 'smw_iq_disabled' )->inContentLanguage()->text() ) );
43
+		if (!$smwgQEnabled) {
44
+			return smwfEncodeMessages(array(wfMessage('smw_iq_disabled')->inContentLanguage()->text()));
45 45
 		}
46 46
 
47 47
 		$smwgIQRunningNumber++;
48 48
 
49 49
 		$params = func_get_args();
50
-		array_shift( $params ); // We already know the $parser.
50
+		array_shift($params); // We already know the $parser.
51 51
 
52
-		list( $queryParams, $otherParams ) = self::separateParams( $params );
53
-		list( $queryResult, $otherParams ) = self::queryAndMergeResults( $queryParams, $otherParams );
52
+		list($queryParams, $otherParams) = self::separateParams($params);
53
+		list($queryResult, $otherParams) = self::queryAndMergeResults($queryParams, $otherParams);
54 54
 
55 55
 		return self::getResultFromQueryResult(
56 56
 			$queryResult,
@@ -65,25 +65,25 @@  discard block
 block discarded – undo
65 65
 	 * @param $params
66 66
 	 * @return array
67 67
 	 */
68
-	public static function separateParams( $params ) {
68
+	public static function separateParams($params) {
69 69
 		$queryParams = array();
70 70
 		$otherParams = array();
71 71
 
72
-		foreach ( $params as $param ) {
72
+		foreach ($params as $param) {
73 73
 			// Very primitive heuristic - if the parameter
74 74
 			// includes a square bracket, then it's a
75 75
 			// sub-query; otherwise it's a regular parameter.
76
-			if ( strpos( $param, '[' ) !== false ) {
76
+			if (strpos($param, '[') !== false) {
77 77
 				$queryParams[] = $param;
78 78
 			} else {
79
-				$parts = explode( '=', $param, 2 );
79
+				$parts = explode('=', $param, 2);
80 80
 
81
-				if ( count( $parts ) >= 2 ) {
82
-					$otherParams[strtolower( trim( $parts[0] ) )] = $parts[1]; // don't trim here, some params care for " "
81
+				if (count($parts) >= 2) {
82
+					$otherParams[strtolower(trim($parts[0]))] = $parts[1]; // don't trim here, some params care for " "
83 83
 				}
84 84
 			}
85 85
 		}
86
-		return array( $queryParams, $otherParams );
86
+		return array($queryParams, $otherParams);
87 87
 	}
88 88
 
89 89
 	/**
@@ -93,36 +93,36 @@  discard block
 block discarded – undo
93 93
 	 * @param $otherParams
94 94
 	 * @return array
95 95
 	 */
96
-	public static function queryAndMergeResults( $queryParams, $otherParams ) {
96
+	public static function queryAndMergeResults($queryParams, $otherParams) {
97 97
 		$results = array();
98 98
 		$printRequests = array();
99 99
 
100
-		foreach ( $queryParams as $param ) {
101
-			$subQueryParams = self::getSubParams( $param );
100
+		foreach ($queryParams as $param) {
101
+			$subQueryParams = self::getSubParams($param);
102 102
 
103
-			if ( array_key_exists( 'format', $otherParams ) && !array_key_exists( 'format', $subQueryParams ) ) {
103
+			if (array_key_exists('format', $otherParams) && !array_key_exists('format', $subQueryParams)) {
104 104
 				$subQueryParams['format'] = $otherParams['format'];
105 105
 			}
106 106
 
107 107
 			$nextResult = self::getQueryResultFromFunctionParams($subQueryParams);
108 108
 
109
-			$results = self::mergeSMWQueryResults( $results, $nextResult->getResults() );
110
-			$printRequests = self::mergeSMWPrintRequests( $printRequests, $nextResult->getPrintRequests() );
109
+			$results = self::mergeSMWQueryResults($results, $nextResult->getResults());
110
+			$printRequests = self::mergeSMWPrintRequests($printRequests, $nextResult->getPrintRequests());
111 111
 		}
112 112
 
113 113
 		// Sort results so that they'll show up by page name
114
-		if( !isset($otherParams['unsorted']) || !strcmp( $otherParams['unsorted'], 'on' ) ) {
115
-			uasort( $results, array( '\SCQ\CompoundQueryProcessor', 'compareQueryResults' ) );
114
+		if (!isset($otherParams['unsorted']) || !strcmp($otherParams['unsorted'], 'on')) {
115
+			uasort($results, array('\SCQ\CompoundQueryProcessor', 'compareQueryResults'));
116 116
 		}
117 117
 
118
-		$queryResult = new CompoundQueryResult( $printRequests, new Query(), $results, smwfGetStore() );
118
+		$queryResult = new CompoundQueryResult($printRequests, new Query(), $results, smwfGetStore());
119 119
 
120
-		if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
121
-			self::addThisPrintout( $printRequests, $otherParams );
122
-			$otherParams = self::getProcessedParams( $otherParams, $printRequests );
120
+		if (version_compare(SMW_VERSION, '1.6.1', '>')) {
121
+			self::addThisPrintout($printRequests, $otherParams);
122
+			$otherParams = self::getProcessedParams($otherParams, $printRequests);
123 123
 		}
124 124
 
125
-		return array( $queryResult, $otherParams );
125
+		return array($queryResult, $otherParams);
126 126
 	}
127 127
 
128 128
 	/**
@@ -134,31 +134,31 @@  discard block
 block discarded – undo
134 134
 	 *
135 135
 	 * @return array
136 136
 	 */
137
-	protected static function getSubParams( $param ) {
137
+	protected static function getSubParams($param) {
138 138
 		$sub_params = array();
139 139
 		$sub_param = '';
140 140
 		$uncompleted_square_brackets = 0;
141 141
 
142
-		for ( $i = 0; $i < strlen( $param ); $i++ ) {
142
+		for ($i = 0; $i < strlen($param); $i++) {
143 143
 			$c = $param[$i];
144 144
 
145
-			if ( ( $c == ';' ) && ( $uncompleted_square_brackets <= 0 ) ) {
146
-				$sub_params[] = trim( $sub_param );
145
+			if (($c == ';') && ($uncompleted_square_brackets <= 0)) {
146
+				$sub_params[] = trim($sub_param);
147 147
 				$sub_param = '';
148 148
 			} else {
149 149
 				$sub_param .= $c;
150 150
 
151
-				if ( $c == '[' ) {
151
+				if ($c == '[') {
152 152
 					$uncompleted_square_brackets++;
153 153
 				}
154 154
 
155
-				elseif ( $c == ']' ) {
155
+				elseif ($c == ']') {
156 156
 					$uncompleted_square_brackets--;
157 157
 				}
158 158
 			}
159 159
 		}
160 160
 
161
-		$sub_params[] = trim( $sub_param );
161
+		$sub_params[] = trim($sub_param);
162 162
 
163 163
 		return $sub_params;
164 164
 	}
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 	 *
171 171
 	 * @return SMWQueryResult
172 172
 	 */
173
-	protected static function getQueryResultFromFunctionParams( $rawparams, $context = QueryProcessor::INLINE_QUERY, $showmode = false ) {
173
+	protected static function getQueryResultFromFunctionParams($rawparams, $context = QueryProcessor::INLINE_QUERY, $showmode = false) {
174 174
 		$printouts = array();
175
-		self::processFunctionParams( $rawparams, $querystring, $params, $printouts, $showmode );
176
-		return self::getQueryResultFromQueryString( $querystring, $params, $printouts, $context );
175
+		self::processFunctionParams($rawparams, $querystring, $params, $printouts, $showmode);
176
+		return self::getQueryResultFromQueryString($querystring, $params, $printouts, $context);
177 177
 	}
178 178
 
179 179
 	/**
@@ -184,19 +184,19 @@  discard block
 block discarded – undo
184 184
 	 *
185 185
 	 * @return array
186 186
 	 */
187
-	protected static function mergeSMWQueryResults( $result1, $result2 ) {
188
-		if ( $result1 == null ) {
187
+	protected static function mergeSMWQueryResults($result1, $result2) {
188
+		if ($result1 == null) {
189 189
 			return $result2;
190 190
 		}
191 191
 
192 192
 		$existing_page_names = array();
193
-		foreach ( $result1 as $r1 ) {
193
+		foreach ($result1 as $r1) {
194 194
 			$existing_page_names[] = $r1->getSerialization();
195 195
 		}
196 196
 
197
-		foreach ( $result2 as $r2 ) {
197
+		foreach ($result2 as $r2) {
198 198
 			$page_name = $r2->getSerialization();
199
-			if ( ! in_array( $page_name, $existing_page_names ) ) {
199
+			if (!in_array($page_name, $existing_page_names)) {
200 200
 				$result1[] = $r2;
201 201
 			}
202 202
 		}
@@ -204,15 +204,15 @@  discard block
 block discarded – undo
204 204
 		return $result1;
205 205
 	}
206 206
 
207
-	protected static function mergeSMWPrintRequests( $printRequests1, $printRequests2 ) {
207
+	protected static function mergeSMWPrintRequests($printRequests1, $printRequests2) {
208 208
 		$existingPrintoutLabels = array();
209
-		foreach ( $printRequests1 as $p1 ) {
209
+		foreach ($printRequests1 as $p1) {
210 210
 			$existingPrintoutLabels[] = $p1->getLabel();
211 211
 		}
212 212
 
213
-		foreach ( $printRequests2 as $p2 ) {
213
+		foreach ($printRequests2 as $p2) {
214 214
 			$label = $p2->getLabel();
215
-			if ( ! in_array( $label, $existingPrintoutLabels ) ) {
215
+			if (!in_array($label, $existingPrintoutLabels)) {
216 216
 				$printRequests1[] = $p2;
217 217
 			}
218 218
 		}
@@ -228,20 +228,20 @@  discard block
 block discarded – undo
228 228
 	 *
229 229
 	 * @return SMWQueryResult
230 230
 	 */
231
-	protected static function getQueryResultFromQueryString( $querystring, array $params, $extraPrintouts, $context = QueryProcessor::INLINE_QUERY ) {
231
+	protected static function getQueryResultFromQueryString($querystring, array $params, $extraPrintouts, $context = QueryProcessor::INLINE_QUERY) {
232 232
 
233
-		if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
234
-			QueryProcessor::addThisPrintout( $extraPrintouts, $params );
235
-			$params = self::getProcessedParams( $params, $extraPrintouts, false );
233
+		if (version_compare(SMW_VERSION, '1.6.1', '>')) {
234
+			QueryProcessor::addThisPrintout($extraPrintouts, $params);
235
+			$params = self::getProcessedParams($params, $extraPrintouts, false);
236 236
 		}
237 237
 
238
-		$query = self::createQuery( $querystring, $params, $context, null, $extraPrintouts );
239
-		$queryResult = smwfGetStore()->getQueryResult( $query );
238
+		$query = self::createQuery($querystring, $params, $context, null, $extraPrintouts);
239
+		$queryResult = smwfGetStore()->getQueryResult($query);
240 240
 
241 241
 		$parameters = array();
242 242
 
243
-		if ( version_compare( SMW_VERSION, '1.7.2', '>' ) ) {
244
-			foreach ( $params as $param ) {
243
+		if (version_compare(SMW_VERSION, '1.7.2', '>')) {
244
+			foreach ($params as $param) {
245 245
 				$parameters[$param->getName()] = $param->getValue();
246 246
 			}
247 247
 		}
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			$parameters = $params;
250 250
 		}
251 251
 
252
-		foreach ( $queryResult->getResults() as $wikiPage ) {
252
+		foreach ($queryResult->getResults() as $wikiPage) {
253 253
 			$wikiPage->display_options = $parameters;
254 254
 		}
255 255
 
@@ -268,20 +268,20 @@  discard block
 block discarded – undo
268 268
 	 *
269 269
 	 * @return string
270 270
 	 */
271
-	protected static function getResultFromQueryResult( CompoundQueryResult $res, array $params, $outputmode, $context = QueryProcessor::INLINE_QUERY, $format = '' ) {
271
+	protected static function getResultFromQueryResult(CompoundQueryResult $res, array $params, $outputmode, $context = QueryProcessor::INLINE_QUERY, $format = '') {
272 272
 
273
-		if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
273
+		if (version_compare(SMW_VERSION, '1.6.1', '>')) {
274 274
 			$format = $params['format'];
275 275
 
276
-			if ( version_compare( SMW_VERSION, '1.7.2', '>' ) ) {
276
+			if (version_compare(SMW_VERSION, '1.7.2', '>')) {
277 277
 				$format = $format->getValue();
278 278
 			}
279 279
 		} else {
280
-			$format = self::getResultFormat( $params );
280
+			$format = self::getResultFormat($params);
281 281
 		}
282 282
 
283
-		$printer = self::getResultPrinter( $format, $context );
284
-		$result = $printer->getResult( $res, $params, $outputmode );
283
+		$printer = self::getResultPrinter($format, $context);
284
+		$result = $printer->getResult($res, $params, $outputmode);
285 285
 
286 286
 		return $result;
287 287
 	}
Please login to merge, or discard this patch.
src/Api/CompoundQuery.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
 	 * @see ApiBase::execute
22 22
 	 */
23 23
 	public function execute() {
24
-		$parameterFormatter = new ApiRequestParameterFormatter( $this->extractRequestParams() );
24
+		$parameterFormatter = new ApiRequestParameterFormatter($this->extractRequestParams());
25 25
 		$parameters = $parameterFormatter->getAskApiParameters();
26 26
 
27
-		list( $queryParams, $otherParams ) = CompoundQueryProcessor::separateParams( $parameters );
28
-		list( $queryResult ) = CompoundQueryProcessor::queryAndMergeResults( $queryParams, $otherParams );
27
+		list($queryParams, $otherParams) = CompoundQueryProcessor::separateParams($parameters);
28
+		list($queryResult) = CompoundQueryProcessor::queryAndMergeResults($queryParams, $otherParams);
29 29
 
30 30
 		$outputFormat = 'json';
31
-		if ( $this->getMain()->getPrinter() instanceof \ApiFormatXml ) {
31
+		if ($this->getMain()->getPrinter() instanceof \ApiFormatXml) {
32 32
 			$outputFormat = 'xml';
33 33
 		}
34 34
 
35
-		$this->addQueryResult( $queryResult, $outputFormat );
35
+		$this->addQueryResult($queryResult, $outputFormat);
36 36
 	}
37 37
 
38 38
 	/**
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	protected function getExamples() {
84 84
 		return array(
85
-			'api.php?action=compoundquery&query=' . urlencode( '[[Has city::Vienna]]; ?Has coordinates|[[Has city::Graz]]; ?Has coordinates' ),
86
-			'api.php?action=compoundquery&query=' . urlencode( '|[[Has city::Vienna]]; ?Has coordinates|[[Has city::Graz]]; ?Has coordinates' ),
85
+			'api.php?action=compoundquery&query=' . urlencode('[[Has city::Vienna]]; ?Has coordinates|[[Has city::Graz]]; ?Has coordinates'),
86
+			'api.php?action=compoundquery&query=' . urlencode('|[[Has city::Vienna]]; ?Has coordinates|[[Has city::Graz]]; ?Has coordinates'),
87 87
 		);
88 88
 	}
89 89
 
Please login to merge, or discard this patch.
src/CompoundQueryResult.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,29 +23,29 @@
 block discarded – undo
23 23
 	 *
24 24
 	 * @param QueryResult $newResult
25 25
 	 */
26
-	public function addResult( QueryResult $newResult ) {
26
+	public function addResult(QueryResult $newResult) {
27 27
 		$existingPageNames = array();
28 28
 
29
-		while ( $row = $this->getNext() ) {
30
-			if ( $row[0] instanceof ResultArray ) {
29
+		while ($row = $this->getNext()) {
30
+			if ($row[0] instanceof ResultArray) {
31 31
 				$content = $row[0]->getContent();
32
-				$existingPageNames[] = $content[0]->getLongText( SMW_OUTPUT_WIKI );
32
+				$existingPageNames[] = $content[0]->getLongText(SMW_OUTPUT_WIKI);
33 33
 			}
34 34
 		}
35 35
 
36
-		while ( ( $row = $newResult->getNext() ) !== false ) {
37
-			if ( property_exists( $newResult, 'display_options' ) ) {
36
+		while (($row = $newResult->getNext()) !== false) {
37
+			if (property_exists($newResult, 'display_options')) {
38 38
 				$row[0]->display_options = $newResult->display_options;
39 39
 			}
40 40
 			$content = $row[0]->getContent();
41
-			$pageName = $content[0]->getLongText( SMW_OUTPUT_WIKI );
41
+			$pageName = $content[0]->getLongText(SMW_OUTPUT_WIKI);
42 42
 
43
-			if ( !in_array( $pageName, $existingPageNames ) ) {
43
+			if (!in_array($pageName, $existingPageNames)) {
44 44
 				$this->m_content[] = $row;
45 45
 			}
46 46
 		}
47 47
 
48
-		reset( $this->m_content );
48
+		reset($this->m_content);
49 49
 	}
50 50
 
51 51
 }
Please login to merge, or discard this patch.
SemanticCompoundQueries.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
  *
6 6
  * @defgroup SemanticCompoundQueries SemanticCompoundQueries
7 7
  */
8
-if ( !defined( 'MEDIAWIKI' ) ) {
9
-	die( 'This file is part of the SemanticCompoundQueries extension, it is not a valid entry point.' );
8
+if (!defined('MEDIAWIKI')) {
9
+	die('This file is part of the SemanticCompoundQueries extension, it is not a valid entry point.');
10 10
 }
11 11
 
12
-if ( defined( 'SCQ_VERSION' ) ) {
12
+if (defined('SCQ_VERSION')) {
13 13
 	// Do not initialize more than once.
14 14
 	return 1;
15 15
 }
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public static function load() {
32 32
 
33
-		if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
33
+		if (is_readable(__DIR__ . '/vendor/autoload.php')) {
34 34
 			include_once __DIR__ . '/vendor/autoload.php';
35 35
 		}
36 36
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	public static function initExtension() {
58 58
 
59
-		define( 'SCQ_VERSION', '1.1.0-alpha' );
59
+		define('SCQ_VERSION', '1.1.0-alpha');
60 60
 
61 61
 		// Register the extension
62 62
 		$GLOBALS['wgExtensionCredits']['semantic'][] = array(
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public static function checkRequirements() {
88 88
 
89
-		if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.13', 'lt' ) ) {
90
-			die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticCompoundQueries/">Semantic Compound Queries</a> is only compatible with MediaWiki 1.13 or above. You need to upgrade MediaWiki first.' );
89
+		if (version_compare($GLOBALS['wgVersion'], '1.13', 'lt')) {
90
+			die('<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticCompoundQueries/">Semantic Compound Queries</a> is only compatible with MediaWiki 1.13 or above. You need to upgrade MediaWiki first.');
91 91
 		}
92 92
 
93
-		if ( !defined( 'SMW_VERSION' ) ) {
94
-			die( '<b>Error:</b> <a href="https://github.com/SemanticMediaWiki/SemanticCompoundQueries/">Semantic Compound Queries</a> requires the <a href="https://github.com/SemanticMediaWiki/SemanticMediaWiki/">Semantic MediaWiki</a> extension, please enable or install the extension first.' );
93
+		if (!defined('SMW_VERSION')) {
94
+			die('<b>Error:</b> <a href="https://github.com/SemanticMediaWiki/SemanticCompoundQueries/">Semantic Compound Queries</a> requires the <a href="https://github.com/SemanticMediaWiki/SemanticMediaWiki/">Semantic MediaWiki</a> extension, please enable or install the extension first.');
95 95
 		}
96 96
 	}
97 97
 
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 		// wgAPIModules
109 109
 		$GLOBALS['wgAPIModules']['compoundquery'] = 'SCQ\Api\CompoundQuery';
110 110
 
111
-		$GLOBALS['wgHooks']['ParserFirstCallInit'][] = function( Parser &$parser  ) {
112
-			$parser->setFunctionHook( 'compound_query', array( '\SCQ\CompoundQueryProcessor', 'doCompoundQuery' ) );
111
+		$GLOBALS['wgHooks']['ParserFirstCallInit'][] = function(Parser&$parser) {
112
+			$parser->setFunctionHook('compound_query', array('\SCQ\CompoundQueryProcessor', 'doCompoundQuery'));
113 113
 
114 114
 			// always return true, in order not to stop MW's hook processing!
115 115
 			return true;
Please login to merge, or discard this patch.