Completed
Push — master ( ce26c7...1f5158 )
by
unknown
06:07
created
src/ConstraintCheck/Helper/ConstraintParameterParser.php 1 patch
Spacing   +214 added lines, -214 removed lines patch added patch discarded remove patch
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
 	 * @param array $parameters
79 79
 	 * @throws ConstraintParameterException
80 80
 	 */
81
-	public function checkError( array $parameters ) {
82
-		if ( array_key_exists( '@error', $parameters ) ) {
81
+	public function checkError(array $parameters) {
82
+		if (array_key_exists('@error', $parameters)) {
83 83
 			$error = $parameters['@error'];
84
-			if ( array_key_exists( 'toolong', $error ) && $error['toolong'] ) {
84
+			if (array_key_exists('toolong', $error) && $error['toolong']) {
85 85
 				$msg = 'wbqc-violation-message-parameters-error-toolong';
86 86
 			} else {
87 87
 				$msg = 'wbqc-violation-message-parameters-error-unknown';
88 88
 			}
89
-			throw new ConstraintParameterException( wfMessage( $msg )->escaped() );
89
+			throw new ConstraintParameterException(wfMessage($msg)->escaped());
90 90
 		}
91 91
 	}
92 92
 
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 	 * @param string $parameterId
97 97
 	 * @throws ConstraintParameterException
98 98
 	 */
99
-	private function requireSingleParameter( array $parameters, $parameterId ) {
100
-		if ( count( $parameters[$parameterId] ) !== 1 ) {
99
+	private function requireSingleParameter(array $parameters, $parameterId) {
100
+		if (count($parameters[$parameterId]) !== 1) {
101 101
 			throw new ConstraintParameterException(
102
-				wfMessage( 'wbqc-violation-message-parameter-single' )
103
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
102
+				wfMessage('wbqc-violation-message-parameter-single')
103
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY))
104 104
 					->escaped()
105 105
 			);
106 106
 		}
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
 	 * @return void
114 114
 	 * @throws ConstraintParameterException
115 115
 	 */
116
-	private function requireValueParameter( Snak $snak, $parameterId ) {
117
-		if ( !( $snak instanceof PropertyValueSnak ) ) {
116
+	private function requireValueParameter(Snak $snak, $parameterId) {
117
+		if (!($snak instanceof PropertyValueSnak)) {
118 118
 			throw new ConstraintParameterException(
119
-				wfMessage( 'wbqc-violation-message-parameter-value' )
120
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
119
+				wfMessage('wbqc-violation-message-parameter-value')
120
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY))
121 121
 					->escaped()
122 122
 			);
123 123
 		}
@@ -130,18 +130,18 @@  discard block
 block discarded – undo
130 130
 	 * @throws ConstraintParameterException
131 131
 	 * @return EntityId
132 132
 	 */
133
-	private function parseEntityIdParameter( array $snakSerialization, $parameterId ) {
134
-		$snak = $this->snakDeserializer->deserialize( $snakSerialization );
135
-		$this->requireValueParameter( $snak, $parameterId );
133
+	private function parseEntityIdParameter(array $snakSerialization, $parameterId) {
134
+		$snak = $this->snakDeserializer->deserialize($snakSerialization);
135
+		$this->requireValueParameter($snak, $parameterId);
136 136
 		$value = $snak->getDataValue();
137
-		if ( $value instanceof EntityIdValue ) {
137
+		if ($value instanceof EntityIdValue) {
138 138
 			return $value->getEntityId();
139 139
 		} else {
140 140
 			throw new ConstraintParameterException(
141
-				wfMessage( 'wbqc-violation-message-parameter-entity' )
141
+				wfMessage('wbqc-violation-message-parameter-entity')
142 142
 					->rawParams(
143
-						$this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY ),
144
-						$this->constraintParameterRenderer->formatDataValue( $value, Role::CONSTRAINT_PARAMETER_VALUE )
143
+						$this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY),
144
+						$this->constraintParameterRenderer->formatDataValue($value, Role::CONSTRAINT_PARAMETER_VALUE)
145 145
 					)
146 146
 					->escaped()
147 147
 			);
@@ -154,21 +154,21 @@  discard block
 block discarded – undo
154 154
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
155 155
 	 * @return string[] class entity ID serializations
156 156
 	 */
157
-	public function parseClassParameter( array $constraintParameters, $constraintTypeItemId ) {
158
-		$this->checkError( $constraintParameters );
159
-		$classId = $this->config->get( 'WBQualityConstraintsClassId' );
160
-		if ( !array_key_exists( $classId, $constraintParameters ) ) {
157
+	public function parseClassParameter(array $constraintParameters, $constraintTypeItemId) {
158
+		$this->checkError($constraintParameters);
159
+		$classId = $this->config->get('WBQualityConstraintsClassId');
160
+		if (!array_key_exists($classId, $constraintParameters)) {
161 161
 			throw new ConstraintParameterException(
162
-				wfMessage( 'wbqc-violation-message-parameter-needed' )
163
-					->rawParams( $this->constraintParameterRenderer->formatItemId( $constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM ) )
164
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $classId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
162
+				wfMessage('wbqc-violation-message-parameter-needed')
163
+					->rawParams($this->constraintParameterRenderer->formatItemId($constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM))
164
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($classId, Role::CONSTRAINT_PARAMETER_PROPERTY))
165 165
 					->escaped()
166 166
 			);
167 167
 		}
168 168
 
169 169
 		$classes = [];
170
-		foreach ( $constraintParameters[$classId] as $class ) {
171
-			$classes[] = $this->parseEntityIdParameter( $class, $classId )->getSerialization();
170
+		foreach ($constraintParameters[$classId] as $class) {
171
+			$classes[] = $this->parseEntityIdParameter($class, $classId)->getSerialization();
172 172
 		}
173 173
 		return $classes;
174 174
 	}
@@ -179,24 +179,24 @@  discard block
 block discarded – undo
179 179
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
180 180
 	 * @return string 'instance', 'subclass', or 'instanceOrSubclass'
181 181
 	 */
182
-	public function parseRelationParameter( array $constraintParameters, $constraintTypeItemId ) {
183
-		$this->checkError( $constraintParameters );
184
-		$relationId = $this->config->get( 'WBQualityConstraintsRelationId' );
185
-		if ( !array_key_exists( $relationId, $constraintParameters ) ) {
182
+	public function parseRelationParameter(array $constraintParameters, $constraintTypeItemId) {
183
+		$this->checkError($constraintParameters);
184
+		$relationId = $this->config->get('WBQualityConstraintsRelationId');
185
+		if (!array_key_exists($relationId, $constraintParameters)) {
186 186
 			throw new ConstraintParameterException(
187
-				wfMessage( 'wbqc-violation-message-parameter-needed' )
188
-					->rawParams( $this->constraintParameterRenderer->formatItemId( $constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM ) )
189
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $relationId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
187
+				wfMessage('wbqc-violation-message-parameter-needed')
188
+					->rawParams($this->constraintParameterRenderer->formatItemId($constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM))
189
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($relationId, Role::CONSTRAINT_PARAMETER_PROPERTY))
190 190
 					->escaped()
191 191
 			);
192 192
 		}
193 193
 
194
-		$this->requireSingleParameter( $constraintParameters, $relationId );
195
-		$relationEntityId = $this->parseEntityIdParameter( $constraintParameters[$relationId][0], $relationId );
196
-		$instanceId = $this->config->get( 'WBQualityConstraintsInstanceOfRelationId' );
197
-		$subclassId = $this->config->get( 'WBQualityConstraintsSubclassOfRelationId' );
198
-		$instanceOrSubclassId = $this->config->get( 'WBQualityConstraintsInstanceOrSubclassOfRelationId' );
199
-		switch ( $relationEntityId ) {
194
+		$this->requireSingleParameter($constraintParameters, $relationId);
195
+		$relationEntityId = $this->parseEntityIdParameter($constraintParameters[$relationId][0], $relationId);
196
+		$instanceId = $this->config->get('WBQualityConstraintsInstanceOfRelationId');
197
+		$subclassId = $this->config->get('WBQualityConstraintsSubclassOfRelationId');
198
+		$instanceOrSubclassId = $this->config->get('WBQualityConstraintsInstanceOrSubclassOfRelationId');
199
+		switch ($relationEntityId) {
200 200
 			case $instanceId:
201 201
 				return 'instance';
202 202
 			case $subclassId:
@@ -205,13 +205,13 @@  discard block
 block discarded – undo
205 205
 				return 'instanceOrSubclass';
206 206
 			default:
207 207
 				throw new ConstraintParameterException(
208
-					wfMessage( 'wbqc-violation-message-parameter-oneof' )
209
-						->rawParams( $this->constraintParameterRenderer->formatPropertyId( $relationId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
210
-						->numParams( 3 )
211
-						->rawParams( $this->constraintParameterRenderer->formatItemIdList(
212
-							[ $instanceId, $subclassId, $instanceOrSubclassId ],
208
+					wfMessage('wbqc-violation-message-parameter-oneof')
209
+						->rawParams($this->constraintParameterRenderer->formatPropertyId($relationId, Role::CONSTRAINT_PARAMETER_PROPERTY))
210
+						->numParams(3)
211
+						->rawParams($this->constraintParameterRenderer->formatItemIdList(
212
+							[$instanceId, $subclassId, $instanceOrSubclassId],
213 213
 							Role::CONSTRAINT_PARAMETER_VALUE
214
-						) )
214
+						))
215 215
 						->escaped()
216 216
 				);
217 217
 		}
@@ -224,21 +224,21 @@  discard block
 block discarded – undo
224 224
 	 * @throws ConstraintParameterException
225 225
 	 * @return PropertyId
226 226
 	 */
227
-	private function parsePropertyIdParameter( array $snakSerialization, $parameterId ) {
228
-		$snak = $this->snakDeserializer->deserialize( $snakSerialization );
229
-		$this->requireValueParameter( $snak, $parameterId );
227
+	private function parsePropertyIdParameter(array $snakSerialization, $parameterId) {
228
+		$snak = $this->snakDeserializer->deserialize($snakSerialization);
229
+		$this->requireValueParameter($snak, $parameterId);
230 230
 		$value = $snak->getDataValue();
231
-		if ( $value instanceof EntityIdValue ) {
231
+		if ($value instanceof EntityIdValue) {
232 232
 			$id = $value->getEntityId();
233
-			if ( $id instanceof PropertyId ) {
233
+			if ($id instanceof PropertyId) {
234 234
 				return $id;
235 235
 			}
236 236
 		}
237 237
 		throw new ConstraintParameterException(
238
-			wfMessage( 'wbqc-violation-message-parameter-property' )
238
+			wfMessage('wbqc-violation-message-parameter-property')
239 239
 				->rawParams(
240
-					$this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY ),
241
-					$this->constraintParameterRenderer->formatDataValue( $value, Role::CONSTRAINT_PARAMETER_VALUE )
240
+					$this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY),
241
+					$this->constraintParameterRenderer->formatDataValue($value, Role::CONSTRAINT_PARAMETER_VALUE)
242 242
 				)
243 243
 				->escaped()
244 244
 		);
@@ -251,34 +251,34 @@  discard block
 block discarded – undo
251 251
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
252 252
 	 * @return PropertyId
253 253
 	 */
254
-	public function parsePropertyParameter( array $constraintParameters, $constraintTypeItemId ) {
255
-		$this->checkError( $constraintParameters );
256
-		$propertyId = $this->config->get( 'WBQualityConstraintsPropertyId' );
257
-		if ( !array_key_exists( $propertyId, $constraintParameters ) ) {
254
+	public function parsePropertyParameter(array $constraintParameters, $constraintTypeItemId) {
255
+		$this->checkError($constraintParameters);
256
+		$propertyId = $this->config->get('WBQualityConstraintsPropertyId');
257
+		if (!array_key_exists($propertyId, $constraintParameters)) {
258 258
 			throw new ConstraintParameterException(
259
-				wfMessage( 'wbqc-violation-message-parameter-needed' )
260
-					->rawParams( $this->constraintParameterRenderer->formatItemId( $constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM ) )
261
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $propertyId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
259
+				wfMessage('wbqc-violation-message-parameter-needed')
260
+					->rawParams($this->constraintParameterRenderer->formatItemId($constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM))
261
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($propertyId, Role::CONSTRAINT_PARAMETER_PROPERTY))
262 262
 					->escaped()
263 263
 			);
264 264
 		}
265 265
 
266
-		$this->requireSingleParameter( $constraintParameters, $propertyId );
267
-		return $this->parsePropertyIdParameter( $constraintParameters[$propertyId][0], $propertyId );
266
+		$this->requireSingleParameter($constraintParameters, $propertyId);
267
+		return $this->parsePropertyIdParameter($constraintParameters[$propertyId][0], $propertyId);
268 268
 	}
269 269
 
270
-	private function parseItemIdParameter( PropertyValueSnak $snak, $parameterId ) {
270
+	private function parseItemIdParameter(PropertyValueSnak $snak, $parameterId) {
271 271
 		$dataValue = $snak->getDataValue();
272
-		if ( $dataValue instanceof EntityIdValue &&
272
+		if ($dataValue instanceof EntityIdValue &&
273 273
 			$dataValue->getEntityId() instanceof ItemId
274 274
 		) {
275
-			return ItemIdSnakValue::fromItemId( $dataValue->getEntityId() );
275
+			return ItemIdSnakValue::fromItemId($dataValue->getEntityId());
276 276
 		} else {
277 277
 			throw new ConstraintParameterException(
278
-				wfMessage( 'wbqc-violation-message-parameter-item' )
278
+				wfMessage('wbqc-violation-message-parameter-item')
279 279
 					->rawParams(
280
-						$this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY ),
281
-						$this->constraintParameterRenderer->formatDataValue( $dataValue, Role::CONSTRAINT_PARAMETER_VALUE )
280
+						$this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY),
281
+						$this->constraintParameterRenderer->formatDataValue($dataValue, Role::CONSTRAINT_PARAMETER_VALUE)
282 282
 					)
283 283
 					->escaped()
284 284
 			);
@@ -292,15 +292,15 @@  discard block
 block discarded – undo
292 292
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
293 293
 	 * @return ItemIdSnakValue[] array of values
294 294
 	 */
295
-	public function parseItemsParameter( array $constraintParameters, $constraintTypeItemId, $required ) {
296
-		$this->checkError( $constraintParameters );
297
-		$qualifierId = $this->config->get( 'WBQualityConstraintsQualifierOfPropertyConstraintId' );
298
-		if ( !array_key_exists( $qualifierId, $constraintParameters ) ) {
299
-			if ( $required ) {
295
+	public function parseItemsParameter(array $constraintParameters, $constraintTypeItemId, $required) {
296
+		$this->checkError($constraintParameters);
297
+		$qualifierId = $this->config->get('WBQualityConstraintsQualifierOfPropertyConstraintId');
298
+		if (!array_key_exists($qualifierId, $constraintParameters)) {
299
+			if ($required) {
300 300
 				throw new ConstraintParameterException(
301
-					wfMessage( 'wbqc-violation-message-parameter-needed' )
302
-						->rawParams( $this->constraintParameterRenderer->formatItemId( $constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM ) )
303
-						->rawParams( $this->constraintParameterRenderer->formatPropertyId( $qualifierId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
301
+					wfMessage('wbqc-violation-message-parameter-needed')
302
+						->rawParams($this->constraintParameterRenderer->formatItemId($constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM))
303
+						->rawParams($this->constraintParameterRenderer->formatPropertyId($qualifierId, Role::CONSTRAINT_PARAMETER_PROPERTY))
304 304
 						->escaped()
305 305
 				);
306 306
 			} else {
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
 		}
310 310
 
311 311
 		$values = [];
312
-		foreach ( $constraintParameters[$qualifierId] as $parameter ) {
313
-			$snak = $this->snakDeserializer->deserialize( $parameter );
314
-			switch ( true ) {
312
+		foreach ($constraintParameters[$qualifierId] as $parameter) {
313
+			$snak = $this->snakDeserializer->deserialize($parameter);
314
+			switch (true) {
315 315
 				case $snak instanceof PropertyValueSnak:
316
-					$values[] = $this->parseItemIdParameter( $snak, $qualifierId );
316
+					$values[] = $this->parseItemIdParameter($snak, $qualifierId);
317 317
 					break;
318 318
 				case $snak instanceof PropertySomeValueSnak:
319 319
 					$values[] = ItemIdSnakValue::someValue();
@@ -332,28 +332,28 @@  discard block
 block discarded – undo
332 332
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
333 333
 	 * @return PropertyId[]
334 334
 	 */
335
-	public function parsePropertiesParameter( array $constraintParameters, $constraintTypeItemId ) {
336
-		$this->checkError( $constraintParameters );
337
-		$propertyId = $this->config->get( 'WBQualityConstraintsPropertyId' );
338
-		if ( !array_key_exists( $propertyId, $constraintParameters ) ) {
335
+	public function parsePropertiesParameter(array $constraintParameters, $constraintTypeItemId) {
336
+		$this->checkError($constraintParameters);
337
+		$propertyId = $this->config->get('WBQualityConstraintsPropertyId');
338
+		if (!array_key_exists($propertyId, $constraintParameters)) {
339 339
 			throw new ConstraintParameterException(
340
-				wfMessage( 'wbqc-violation-message-parameter-needed' )
341
-					->rawParams( $this->constraintParameterRenderer->formatItemId( $constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM ) )
342
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $propertyId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
340
+				wfMessage('wbqc-violation-message-parameter-needed')
341
+					->rawParams($this->constraintParameterRenderer->formatItemId($constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM))
342
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($propertyId, Role::CONSTRAINT_PARAMETER_PROPERTY))
343 343
 					->escaped()
344 344
 			);
345 345
 		}
346 346
 
347 347
 		$parameters = $constraintParameters[$propertyId];
348
-		if ( count( $parameters ) === 1 &&
349
-			$this->snakDeserializer->deserialize( $parameters[0] ) instanceof PropertyNoValueSnak
348
+		if (count($parameters) === 1 &&
349
+			$this->snakDeserializer->deserialize($parameters[0]) instanceof PropertyNoValueSnak
350 350
 		) {
351 351
 			return [];
352 352
 		}
353 353
 
354 354
 		$properties = [];
355
-		foreach ( $parameters as $parameter ) {
356
-			$properties[] = $this->parsePropertyIdParameter( $parameter, $propertyId );
355
+		foreach ($parameters as $parameter) {
356
+			$properties[] = $this->parsePropertyIdParameter($parameter, $propertyId);
357 357
 		}
358 358
 		return $properties;
359 359
 	}
@@ -364,16 +364,16 @@  discard block
 block discarded – undo
364 364
 	 * @throws ConstraintParameterException
365 365
 	 * @return DataValue|null
366 366
 	 */
367
-	private function parseValueOrNoValueParameter( array $snakSerialization, $parameterId ) {
368
-		$snak = $this->snakDeserializer->deserialize( $snakSerialization );
369
-		if ( $snak instanceof PropertyValueSnak ) {
367
+	private function parseValueOrNoValueParameter(array $snakSerialization, $parameterId) {
368
+		$snak = $this->snakDeserializer->deserialize($snakSerialization);
369
+		if ($snak instanceof PropertyValueSnak) {
370 370
 			return $snak->getDataValue();
371
-		} elseif ( $snak instanceof PropertyNoValueSnak ) {
371
+		} elseif ($snak instanceof PropertyNoValueSnak) {
372 372
 			return null;
373 373
 		} else {
374 374
 			throw new ConstraintParameterException(
375
-				wfMessage( 'wbqc-violation-message-parameter-value-or-novalue' )
376
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
375
+				wfMessage('wbqc-violation-message-parameter-value-or-novalue')
376
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY))
377 377
 					->escaped()
378 378
 			);
379 379
 		}
@@ -384,13 +384,13 @@  discard block
 block discarded – undo
384 384
 	 * @param string $parameterId
385 385
 	 * @return DataValue|null
386 386
 	 */
387
-	private function parseValueOrNoValueOrNowParameter( array $snakSerialization, $parameterId ) {
387
+	private function parseValueOrNoValueOrNowParameter(array $snakSerialization, $parameterId) {
388 388
 		try {
389
-			return $this->parseValueOrNoValueParameter( $snakSerialization, $parameterId );
390
-		} catch ( ConstraintParameterException $e ) {
389
+			return $this->parseValueOrNoValueParameter($snakSerialization, $parameterId);
390
+		} catch (ConstraintParameterException $e) {
391 391
 			// unknown value means “now”
392
-			$timeParser = ( new TimeParserFactory() )->getTimeParser();
393
-			return $timeParser->parse( gmdate( '+Y-m-d\T00:00:00\Z' ) );
392
+			$timeParser = (new TimeParserFactory())->getTimeParser();
393
+			return $timeParser->parse(gmdate('+Y-m-d\T00:00:00\Z'));
394 394
 		}
395 395
 	}
396 396
 
@@ -401,14 +401,14 @@  discard block
 block discarded – undo
401 401
 	 * @param string $unit
402 402
 	 * @return bool
403 403
 	 */
404
-	private function exactlyOneQuantityWithUnit( DataValue $min = null, DataValue $max = null, $unit ) {
405
-		if ( !( $min instanceof UnboundedQuantityValue ) ||
406
-			!( $max instanceof UnboundedQuantityValue )
404
+	private function exactlyOneQuantityWithUnit(DataValue $min = null, DataValue $max = null, $unit) {
405
+		if (!($min instanceof UnboundedQuantityValue) ||
406
+			!($max instanceof UnboundedQuantityValue)
407 407
 		) {
408 408
 			return false;
409 409
 		}
410 410
 
411
-		return ( $min->getUnit() === $unit ) !== ( $max->getUnit() === $unit );
411
+		return ($min->getUnit() === $unit) !== ($max->getUnit() === $unit);
412 412
 	}
413 413
 
414 414
 	/**
@@ -419,9 +419,9 @@  discard block
 block discarded – undo
419 419
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
420 420
 	 * @return DataValue[] a pair of two data values, either of which may be null to signify an open range
421 421
 	 */
422
-	public function parseRangeParameter( array $constraintParameters, $constraintTypeItemId, $type ) {
423
-		$this->checkError( $constraintParameters );
424
-		switch ( $type ) {
422
+	public function parseRangeParameter(array $constraintParameters, $constraintTypeItemId, $type) {
423
+		$this->checkError($constraintParameters);
424
+		switch ($type) {
425 425
 			case 'quantity':
426 426
 				$configKey = 'Quantity';
427 427
 				break;
@@ -430,58 +430,58 @@  discard block
 block discarded – undo
430 430
 				break;
431 431
 			default:
432 432
 				throw new ConstraintParameterException(
433
-					wfMessage( 'wbqc-violation-message-value-needed-of-types-2' )
433
+					wfMessage('wbqc-violation-message-value-needed-of-types-2')
434 434
 						->rawParams(
435
-							$this->constraintParameterRenderer->formatItemId( $constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM ),
436
-							wfMessage( 'datatypes-type-quantity' )->escaped(),
437
-							wfMessage( 'datatypes-type-time' )->escaped()
435
+							$this->constraintParameterRenderer->formatItemId($constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM),
436
+							wfMessage('datatypes-type-quantity')->escaped(),
437
+							wfMessage('datatypes-type-time')->escaped()
438 438
 						)
439 439
 						->escaped()
440 440
 				);
441 441
 		}
442
-		$minimumId = $this->config->get( 'WBQualityConstraintsMinimum' . $configKey . 'Id' );
443
-		$maximumId = $this->config->get( 'WBQualityConstraintsMaximum' . $configKey . 'Id' );
444
-		if ( !array_key_exists( $minimumId, $constraintParameters ) ||
445
-			!array_key_exists( $maximumId, $constraintParameters )
442
+		$minimumId = $this->config->get('WBQualityConstraintsMinimum'.$configKey.'Id');
443
+		$maximumId = $this->config->get('WBQualityConstraintsMaximum'.$configKey.'Id');
444
+		if (!array_key_exists($minimumId, $constraintParameters) ||
445
+			!array_key_exists($maximumId, $constraintParameters)
446 446
 		) {
447 447
 			throw new ConstraintParameterException(
448
-				wfMessage( 'wbqc-violation-message-range-parameters-needed' )
448
+				wfMessage('wbqc-violation-message-range-parameters-needed')
449 449
 					->rawParams(
450
-						wfMessage( 'datatypes-type-' . $type )->escaped(),
451
-						$this->constraintParameterRenderer->formatPropertyId( $minimumId, Role::CONSTRAINT_PARAMETER_PROPERTY ),
452
-						$this->constraintParameterRenderer->formatPropertyId( $maximumId, Role::CONSTRAINT_PARAMETER_PROPERTY )
450
+						wfMessage('datatypes-type-'.$type)->escaped(),
451
+						$this->constraintParameterRenderer->formatPropertyId($minimumId, Role::CONSTRAINT_PARAMETER_PROPERTY),
452
+						$this->constraintParameterRenderer->formatPropertyId($maximumId, Role::CONSTRAINT_PARAMETER_PROPERTY)
453 453
 					)
454
-					->rawParams( $this->constraintParameterRenderer->formatItemId( $constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM ) )
454
+					->rawParams($this->constraintParameterRenderer->formatItemId($constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM))
455 455
 					->escaped()
456 456
 			);
457 457
 		}
458 458
 
459
-		$this->requireSingleParameter( $constraintParameters, $minimumId );
460
-		$this->requireSingleParameter( $constraintParameters, $maximumId );
459
+		$this->requireSingleParameter($constraintParameters, $minimumId);
460
+		$this->requireSingleParameter($constraintParameters, $maximumId);
461 461
 		$parseFunction = $configKey === 'Date' ? 'parseValueOrNoValueOrNowParameter' : 'parseValueOrNoValueParameter';
462
-		$min = $this->$parseFunction( $constraintParameters[$minimumId][0], $minimumId );
463
-		$max = $this->$parseFunction( $constraintParameters[$maximumId][0], $maximumId );
462
+		$min = $this->$parseFunction($constraintParameters[$minimumId][0], $minimumId);
463
+		$max = $this->$parseFunction($constraintParameters[$maximumId][0], $maximumId);
464 464
 
465
-		$yearUnit = $this->config->get( 'WBQualityConstraintsYearUnit' );
466
-		if ( $this->exactlyOneQuantityWithUnit( $min, $max, $yearUnit ) ) {
465
+		$yearUnit = $this->config->get('WBQualityConstraintsYearUnit');
466
+		if ($this->exactlyOneQuantityWithUnit($min, $max, $yearUnit)) {
467 467
 			throw new ConstraintParameterException(
468
-				wfMessage( 'wbqc-violation-message-range-parameters-one-year' )
468
+				wfMessage('wbqc-violation-message-range-parameters-one-year')
469 469
 					->escaped()
470 470
 			);
471 471
 		}
472
-		if ( $min === null && $max === null ||
473
-			$min !== null && $max !== null && $min->equals( $max ) ) {
472
+		if ($min === null && $max === null ||
473
+			$min !== null && $max !== null && $min->equals($max)) {
474 474
 			throw new ConstraintParameterException(
475
-				wfMessage( 'wbqc-violation-message-range-parameters-same' )
475
+				wfMessage('wbqc-violation-message-range-parameters-same')
476 476
 					->rawParams(
477
-						$this->constraintParameterRenderer->formatPropertyId( $minimumId, Role::CONSTRAINT_PARAMETER_PROPERTY ),
478
-						$this->constraintParameterRenderer->formatPropertyId( $maximumId, Role::CONSTRAINT_PARAMETER_PROPERTY )
477
+						$this->constraintParameterRenderer->formatPropertyId($minimumId, Role::CONSTRAINT_PARAMETER_PROPERTY),
478
+						$this->constraintParameterRenderer->formatPropertyId($maximumId, Role::CONSTRAINT_PARAMETER_PROPERTY)
479 479
 					)
480 480
 					->escaped()
481 481
 			);
482 482
 		}
483 483
 
484
-		return [ $min, $max ];
484
+		return [$min, $max];
485 485
 	}
486 486
 
487 487
 	/**
@@ -491,18 +491,18 @@  discard block
 block discarded – undo
491 491
 	 * @throws ConstraintParameterException
492 492
 	 * @return string
493 493
 	 */
494
-	private function parseStringParameter( array $snakSerialization, $parameterId ) {
495
-		$snak = $this->snakDeserializer->deserialize( $snakSerialization );
496
-		$this->requireValueParameter( $snak, $parameterId );
494
+	private function parseStringParameter(array $snakSerialization, $parameterId) {
495
+		$snak = $this->snakDeserializer->deserialize($snakSerialization);
496
+		$this->requireValueParameter($snak, $parameterId);
497 497
 		$value = $snak->getDataValue();
498
-		if ( $value instanceof StringValue ) {
498
+		if ($value instanceof StringValue) {
499 499
 			return $value->getValue();
500 500
 		} else {
501 501
 			throw new ConstraintParameterException(
502
-				wfMessage( 'wbqc-violation-message-parameter-string' )
502
+				wfMessage('wbqc-violation-message-parameter-string')
503 503
 					->rawParams(
504
-						$this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY ),
505
-						$this->constraintParameterRenderer->formatDataValue( $value, Role::CONSTRAINT_PARAMETER_VALUE )
504
+						$this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY),
505
+						$this->constraintParameterRenderer->formatDataValue($value, Role::CONSTRAINT_PARAMETER_VALUE)
506 506
 					)
507 507
 					->escaped()
508 508
 			);
@@ -515,15 +515,15 @@  discard block
 block discarded – undo
515 515
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
516 516
 	 * @return string
517 517
 	 */
518
-	public function parseNamespaceParameter( array $constraintParameters, $constraintTypeItemId ) {
519
-		$this->checkError( $constraintParameters );
520
-		$namespaceId = $this->config->get( 'WBQualityConstraintsNamespaceId' );
521
-		if ( !array_key_exists( $namespaceId, $constraintParameters ) ) {
518
+	public function parseNamespaceParameter(array $constraintParameters, $constraintTypeItemId) {
519
+		$this->checkError($constraintParameters);
520
+		$namespaceId = $this->config->get('WBQualityConstraintsNamespaceId');
521
+		if (!array_key_exists($namespaceId, $constraintParameters)) {
522 522
 			return '';
523 523
 		}
524 524
 
525
-		$this->requireSingleParameter( $constraintParameters, $namespaceId );
526
-		return $this->parseStringParameter( $constraintParameters[$namespaceId][0], $namespaceId );
525
+		$this->requireSingleParameter($constraintParameters, $namespaceId);
526
+		return $this->parseStringParameter($constraintParameters[$namespaceId][0], $namespaceId);
527 527
 	}
528 528
 
529 529
 	/**
@@ -532,20 +532,20 @@  discard block
 block discarded – undo
532 532
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
533 533
 	 * @return string
534 534
 	 */
535
-	public function parseFormatParameter( array $constraintParameters, $constraintTypeItemId ) {
536
-		$this->checkError( $constraintParameters );
537
-		$formatId = $this->config->get( 'WBQualityConstraintsFormatAsARegularExpressionId' );
538
-		if ( !array_key_exists( $formatId, $constraintParameters ) ) {
535
+	public function parseFormatParameter(array $constraintParameters, $constraintTypeItemId) {
536
+		$this->checkError($constraintParameters);
537
+		$formatId = $this->config->get('WBQualityConstraintsFormatAsARegularExpressionId');
538
+		if (!array_key_exists($formatId, $constraintParameters)) {
539 539
 			throw new ConstraintParameterException(
540
-				wfMessage( 'wbqc-violation-message-parameter-needed' )
541
-					->rawParams( $this->constraintParameterRenderer->formatItemId( $constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM ) )
542
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $formatId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
540
+				wfMessage('wbqc-violation-message-parameter-needed')
541
+					->rawParams($this->constraintParameterRenderer->formatItemId($constraintTypeItemId, Role::CONSTRAINT_TYPE_ITEM))
542
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($formatId, Role::CONSTRAINT_PARAMETER_PROPERTY))
543 543
 					->escaped()
544 544
 			);
545 545
 		}
546 546
 
547
-		$this->requireSingleParameter( $constraintParameters, $formatId );
548
-		return $this->parseStringParameter( $constraintParameters[$formatId][0], $formatId );
547
+		$this->requireSingleParameter($constraintParameters, $formatId);
548
+		return $this->parseStringParameter($constraintParameters[$formatId][0], $formatId);
549 549
 	}
550 550
 
551 551
 	/**
@@ -553,16 +553,16 @@  discard block
 block discarded – undo
553 553
 	 * @throws ConstraintParameterException if the parameter is invalid
554 554
 	 * @return EntityId[]
555 555
 	 */
556
-	public function parseExceptionParameter( array $constraintParameters ) {
557
-		$this->checkError( $constraintParameters );
558
-		$exceptionId = $this->config->get( 'WBQualityConstraintsExceptionToConstraintId' );
559
-		if ( !array_key_exists( $exceptionId, $constraintParameters ) ) {
556
+	public function parseExceptionParameter(array $constraintParameters) {
557
+		$this->checkError($constraintParameters);
558
+		$exceptionId = $this->config->get('WBQualityConstraintsExceptionToConstraintId');
559
+		if (!array_key_exists($exceptionId, $constraintParameters)) {
560 560
 			return [];
561 561
 		}
562 562
 
563 563
 		return array_map(
564
-			function( $snakSerialization ) use ( $exceptionId ) {
565
-				return $this->parseEntityIdParameter( $snakSerialization, $exceptionId );
564
+			function($snakSerialization) use ($exceptionId) {
565
+				return $this->parseEntityIdParameter($snakSerialization, $exceptionId);
566 566
 			},
567 567
 			$constraintParameters[$exceptionId]
568 568
 		);
@@ -573,27 +573,27 @@  discard block
 block discarded – undo
573 573
 	 * @throws ConstraintParameterException if the parameter is invalid
574 574
 	 * @return string|null 'mandatory' or null
575 575
 	 */
576
-	public function parseConstraintStatusParameter( array $constraintParameters ) {
577
-		$this->checkError( $constraintParameters );
578
-		$constraintStatusId = $this->config->get( 'WBQualityConstraintsConstraintStatusId' );
579
-		if ( !array_key_exists( $constraintStatusId, $constraintParameters ) ) {
576
+	public function parseConstraintStatusParameter(array $constraintParameters) {
577
+		$this->checkError($constraintParameters);
578
+		$constraintStatusId = $this->config->get('WBQualityConstraintsConstraintStatusId');
579
+		if (!array_key_exists($constraintStatusId, $constraintParameters)) {
580 580
 			return null;
581 581
 		}
582 582
 
583
-		$mandatoryId = $this->config->get( 'WBQualityConstraintsMandatoryConstraintId' );
584
-		$this->requireSingleParameter( $constraintParameters, $constraintStatusId );
585
-		$snak = $this->snakDeserializer->deserialize( $constraintParameters[$constraintStatusId][0] );
586
-		$this->requireValueParameter( $snak, $constraintStatusId );
583
+		$mandatoryId = $this->config->get('WBQualityConstraintsMandatoryConstraintId');
584
+		$this->requireSingleParameter($constraintParameters, $constraintStatusId);
585
+		$snak = $this->snakDeserializer->deserialize($constraintParameters[$constraintStatusId][0]);
586
+		$this->requireValueParameter($snak, $constraintStatusId);
587 587
 		$statusId = $snak->getDataValue()->getEntityId()->getSerialization();
588 588
 
589
-		if ( $statusId === $mandatoryId ) {
589
+		if ($statusId === $mandatoryId) {
590 590
 			return 'mandatory';
591 591
 		} else {
592 592
 			throw new ConstraintParameterException(
593
-				wfMessage( 'wbqc-violation-message-parameter-oneof' )
594
-					->rawParams( $this->constraintParameterRenderer->formatPropertyId( $constraintStatusId, Role::CONSTRAINT_PARAMETER_PROPERTY ) )
595
-					->numParams( 1 )
596
-					->rawParams( $this->constraintParameterRenderer->formatItemIdList( [ $mandatoryId ], Role::CONSTRAINT_PARAMETER_VALUE ) )
593
+				wfMessage('wbqc-violation-message-parameter-oneof')
594
+					->rawParams($this->constraintParameterRenderer->formatPropertyId($constraintStatusId, Role::CONSTRAINT_PARAMETER_PROPERTY))
595
+					->numParams(1)
596
+					->rawParams($this->constraintParameterRenderer->formatItemIdList([$mandatoryId], Role::CONSTRAINT_PARAMETER_VALUE))
597 597
 					->escaped()
598 598
 			);
599 599
 		}
@@ -606,13 +606,13 @@  discard block
 block discarded – undo
606 606
 	 * @return void
607 607
 	 * @throws ConstraintParameterException
608 608
 	 */
609
-	private function requireMonolingualTextParameter( DataValue $dataValue, $parameterId ) {
610
-		if ( !( $dataValue instanceof MonolingualTextValue ) ) {
609
+	private function requireMonolingualTextParameter(DataValue $dataValue, $parameterId) {
610
+		if (!($dataValue instanceof MonolingualTextValue)) {
611 611
 			throw new ConstraintParameterException(
612
-				wfMessage( 'wbqc-violation-message-parameter-monolingualtext' )
612
+				wfMessage('wbqc-violation-message-parameter-monolingualtext')
613 613
 					->rawParams(
614
-						$this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY ),
615
-						$this->constraintParameterRenderer->formatDataValue( $dataValue, Role::CONSTRAINT_PARAMETER_VALUE )
614
+						$this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY),
615
+						$this->constraintParameterRenderer->formatDataValue($dataValue, Role::CONSTRAINT_PARAMETER_VALUE)
616 616
 					)
617 617
 					->escaped()
618 618
 			);
@@ -627,26 +627,26 @@  discard block
 block discarded – undo
627 627
 	 * @throws ConstraintParameterException if invalid snaks are found or a language has multiple texts
628 628
 	 * @return MultilingualTextValue
629 629
 	 */
630
-	private function parseMultilingualTextParameter( array $snakSerializations, $parameterId ) {
630
+	private function parseMultilingualTextParameter(array $snakSerializations, $parameterId) {
631 631
 		$result = [];
632 632
 
633
-		foreach ( $snakSerializations as $snakSerialization ) {
634
-			$snak = $this->snakDeserializer->deserialize( $snakSerialization );
635
-			$this->requireValueParameter( $snak, $parameterId );
633
+		foreach ($snakSerializations as $snakSerialization) {
634
+			$snak = $this->snakDeserializer->deserialize($snakSerialization);
635
+			$this->requireValueParameter($snak, $parameterId);
636 636
 
637 637
 			$value = $snak->getDataValue();
638
-			$this->requireMonolingualTextParameter( $value, $parameterId );
638
+			$this->requireMonolingualTextParameter($value, $parameterId);
639 639
 			/** @var MonolingualTextValue $value */
640 640
 
641 641
 			$code = $value->getLanguageCode();
642
-			if ( array_key_exists( $code, $result ) ) {
642
+			if (array_key_exists($code, $result)) {
643 643
 				throw new ConstraintParameterException(
644
-					wfMessage( 'wbqc-violation-message-parameter-single-per-language' )
644
+					wfMessage('wbqc-violation-message-parameter-single-per-language')
645 645
 						->rawParams(
646
-							$this->constraintParameterRenderer->formatPropertyId( $parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY )
646
+							$this->constraintParameterRenderer->formatPropertyId($parameterId, Role::CONSTRAINT_PARAMETER_PROPERTY)
647 647
 						)
648 648
 						->plaintextParams(
649
-							Language::fetchLanguageName( $code ),
649
+							Language::fetchLanguageName($code),
650 650
 							$code
651 651
 						)
652 652
 						->escaped()
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 			$result[$code] = $value;
657 657
 		}
658 658
 
659
-		return new MultilingualTextValue( $result );
659
+		return new MultilingualTextValue($result);
660 660
 	}
661 661
 
662 662
 	/**
@@ -664,11 +664,11 @@  discard block
 block discarded – undo
664 664
 	 * @throws ConstraintParameterException if the parameter is invalid
665 665
 	 * @return MultilingualTextValue
666 666
 	 */
667
-	public function parseSyntaxClarificationParameter( array $constraintParameters ) {
668
-		$syntaxClarificationId = $this->config->get( 'WBQualityConstraintsSyntaxClarificationId' );
667
+	public function parseSyntaxClarificationParameter(array $constraintParameters) {
668
+		$syntaxClarificationId = $this->config->get('WBQualityConstraintsSyntaxClarificationId');
669 669
 
670
-		if ( !array_key_exists( $syntaxClarificationId, $constraintParameters ) ) {
671
-			return new MultilingualTextValue( [] );
670
+		if (!array_key_exists($syntaxClarificationId, $constraintParameters)) {
671
+			return new MultilingualTextValue([]);
672 672
 		}
673 673
 
674 674
 		$syntaxClarifications = $this->parseMultilingualTextParameter(
@@ -687,20 +687,20 @@  discard block
 block discarded – undo
687 687
 	 * @throws ConstraintParameterException if the parameter is invalid
688 688
 	 * @return string[]|null Context::TYPE_* constants
689 689
 	 */
690
-	public function parseConstraintScopeParameter( array $constraintParameters, $constraintTypeItemId, array $validScopes = null ) {
691
-		$constraintScopeId = $this->config->get( 'WBQualityConstraintsConstraintScopeId' );
692
-		$mainSnakId = $this->config->get( 'WBQualityConstraintsConstraintCheckedOnMainValueId' );
693
-		$qualifiersId = $this->config->get( 'WBQualityConstraintsConstraintCheckedOnQualifiersId' );
694
-		$referencesId = $this->config->get( 'WBQualityConstraintsConstraintCheckedOnReferencesId' );
690
+	public function parseConstraintScopeParameter(array $constraintParameters, $constraintTypeItemId, array $validScopes = null) {
691
+		$constraintScopeId = $this->config->get('WBQualityConstraintsConstraintScopeId');
692
+		$mainSnakId = $this->config->get('WBQualityConstraintsConstraintCheckedOnMainValueId');
693
+		$qualifiersId = $this->config->get('WBQualityConstraintsConstraintCheckedOnQualifiersId');
694
+		$referencesId = $this->config->get('WBQualityConstraintsConstraintCheckedOnReferencesId');
695 695
 
696
-		if ( !array_key_exists( $constraintScopeId, $constraintParameters ) ) {
696
+		if (!array_key_exists($constraintScopeId, $constraintParameters)) {
697 697
 			return null;
698 698
 		}
699 699
 
700 700
 		$contextTypes = [];
701
-		foreach ( $constraintParameters[$constraintScopeId] as $snakSerialization ) {
702
-			$scopeEntityId = $this->parseEntityIdParameter( $snakSerialization, $constraintScopeId );
703
-			switch ( $scopeEntityId->getSerialization() ) {
701
+		foreach ($constraintParameters[$constraintScopeId] as $snakSerialization) {
702
+			$scopeEntityId = $this->parseEntityIdParameter($snakSerialization, $constraintScopeId);
703
+			switch ($scopeEntityId->getSerialization()) {
704 704
 				case $mainSnakId:
705 705
 					$contextTypes[] = Context::TYPE_STATEMENT;
706 706
 					break;
@@ -712,14 +712,14 @@  discard block
 block discarded – undo
712 712
 					break;
713 713
 				default:
714 714
 					throw new ConstraintParameterException(
715
-						wfMessage( 'wbqc-violation-message-parameter-oneof' )
715
+						wfMessage('wbqc-violation-message-parameter-oneof')
716 716
 							->rawParams(
717 717
 								$this->constraintParameterRenderer->formatPropertyId(
718 718
 									$constraintScopeId,
719 719
 									Role::CONSTRAINT_PARAMETER_PROPERTY
720 720
 								)
721 721
 							)
722
-							->numParams( 3 )
722
+							->numParams(3)
723 723
 							->rawParams(
724 724
 								$this->constraintParameterRenderer->formatItemIdList(
725 725
 									[
@@ -735,12 +735,12 @@  discard block
 block discarded – undo
735 735
 			}
736 736
 		}
737 737
 
738
-		if ( $validScopes !== null ) {
739
-			$invalidScopes = array_diff( $contextTypes, $validScopes );
740
-			if ( $invalidScopes !== [] ) {
741
-				$invalidScope = array_pop( $invalidScopes );
738
+		if ($validScopes !== null) {
739
+			$invalidScopes = array_diff($contextTypes, $validScopes);
740
+			if ($invalidScopes !== []) {
741
+				$invalidScope = array_pop($invalidScopes);
742 742
 				throw new ConstraintParameterException(
743
-					wfMessage( 'wbqc-violation-message-invalid-scope' )
743
+					wfMessage('wbqc-violation-message-invalid-scope')
744 744
 						->rawParams(
745 745
 							$this->constraintParameterRenderer->formatConstraintScope(
746 746
 								$invalidScope,
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 								Role::CONSTRAINT_TYPE_ITEM
752 752
 							)
753 753
 						)
754
-						->numParams( count( $validScopes ) )
754
+						->numParams(count($validScopes))
755 755
 						->rawParams(
756 756
 							$this->constraintParameterRenderer->formatConstraintScopeList(
757 757
 								$validScopes,
Please login to merge, or discard this patch.