Completed
Push — master ( e3950b...eec02d )
by
unknown
03:17
created
src/ConstraintReportFactory.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	public static function getDefaultInstance() {
155 155
 		static $instance = null;
156 156
 
157
-		if ( $instance === null ) {
157
+		if ($instance === null) {
158 158
 			$wikibaseRepo = WikibaseRepo::getDefaultInstance();
159 159
 			$entityIdFormatter = $wikibaseRepo->getEntityIdHtmlLinkFormatterFactory()->getEntityIdFormatter(
160 160
 				$wikibaseRepo->getLanguageFallbackLabelDescriptionLookupFactory()->newLabelDescriptionLookup(
@@ -235,21 +235,21 @@  discard block
 block discarded – undo
235 235
 	 * @return DelegatingConstraintChecker
236 236
 	 */
237 237
 	public function getConstraintChecker() {
238
-		if ( $this->delegatingConstraintChecker === null ) {
238
+		if ($this->delegatingConstraintChecker === null) {
239 239
 			$this->delegatingConstraintChecker = new DelegatingConstraintChecker(
240 240
 				$this->lookup,
241 241
 				$this->getConstraintCheckerMap(),
242
-				new CachingConstraintLookup( $this->getConstraintRepository() ),
242
+				new CachingConstraintLookup($this->getConstraintRepository()),
243 243
 				$this->constraintParameterParser,
244 244
 				$this->statementGuidParser,
245 245
 				new LoggingHelper(
246 246
 					$this->dataFactory,
247
-					LoggerFactory::getInstance( 'WikibaseQualityConstraints' ),
247
+					LoggerFactory::getInstance('WikibaseQualityConstraints'),
248 248
 					$this->config
249 249
 				),
250
-				$this->config->get( 'WBQualityConstraintsCheckQualifiers' ),
251
-				$this->config->get( 'WBQualityConstraintsCheckReferences' ),
252
-				$this->config->get( 'WBQualityConstraintsPropertiesWithViolatingQualifiers' )
250
+				$this->config->get('WBQualityConstraintsCheckQualifiers'),
251
+				$this->config->get('WBQualityConstraintsCheckReferences'),
252
+				$this->config->get('WBQualityConstraintsPropertiesWithViolatingQualifiers')
253 253
 			);
254 254
 		}
255 255
 
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 	 * @return ConstraintChecker[]
261 261
 	 */
262 262
 	private function getConstraintCheckerMap() {
263
-		if ( $this->constraintCheckerMap === null ) {
263
+		if ($this->constraintCheckerMap === null) {
264 264
 			$connectionCheckerHelper = new ConnectionCheckerHelper();
265
-			$rangeCheckerHelper = new RangeCheckerHelper( $this->config, $this->unitConverter );
266
-			if ( $this->config->get( 'WBQualityConstraintsSparqlEndpoint' ) !== '' ) {
265
+			$rangeCheckerHelper = new RangeCheckerHelper($this->config, $this->unitConverter);
266
+			if ($this->config->get('WBQualityConstraintsSparqlEndpoint') !== '') {
267 267
 				$sparqlHelper = new SparqlHelper(
268 268
 					$this->config,
269 269
 					$this->rdfVocabulary,
@@ -286,74 +286,74 @@  discard block
 block discarded – undo
286 286
 			);
287 287
 
288 288
 			$this->constraintCheckerMap = [
289
-				$this->config->get( 'WBQualityConstraintsConflictsWithConstraintId' )
289
+				$this->config->get('WBQualityConstraintsConflictsWithConstraintId')
290 290
 					=> new ConflictsWithChecker(
291 291
 						$this->lookup,
292 292
 						$this->constraintParameterParser,
293 293
 						$connectionCheckerHelper,
294 294
 						$this->constraintParameterRenderer
295 295
 					),
296
-				$this->config->get( 'WBQualityConstraintsItemRequiresClaimConstraintId' )
296
+				$this->config->get('WBQualityConstraintsItemRequiresClaimConstraintId')
297 297
 					=> new ItemChecker(
298 298
 						$this->lookup,
299 299
 						$this->constraintParameterParser,
300 300
 						$connectionCheckerHelper,
301 301
 						$this->constraintParameterRenderer
302 302
 					),
303
-				$this->config->get( 'WBQualityConstraintsValueRequiresClaimConstraintId' )
303
+				$this->config->get('WBQualityConstraintsValueRequiresClaimConstraintId')
304 304
 					=> new TargetRequiredClaimChecker(
305 305
 						$this->lookup,
306 306
 						$this->constraintParameterParser,
307 307
 						$connectionCheckerHelper,
308 308
 						$this->constraintParameterRenderer
309 309
 					),
310
-				$this->config->get( 'WBQualityConstraintsSymmetricConstraintId' )
310
+				$this->config->get('WBQualityConstraintsSymmetricConstraintId')
311 311
 					=> new SymmetricChecker(
312 312
 						$this->lookup,
313 313
 						$connectionCheckerHelper,
314 314
 						$this->constraintParameterRenderer
315 315
 					),
316
-				$this->config->get( 'WBQualityConstraintsInverseConstraintId' )
316
+				$this->config->get('WBQualityConstraintsInverseConstraintId')
317 317
 					=> new InverseChecker(
318 318
 						$this->lookup,
319 319
 						$this->constraintParameterParser,
320 320
 						$connectionCheckerHelper,
321 321
 						$this->constraintParameterRenderer
322 322
 					),
323
-				$this->config->get( 'WBQualityConstraintsUsedAsQualifierConstraintId' )
323
+				$this->config->get('WBQualityConstraintsUsedAsQualifierConstraintId')
324 324
 					=> new QualifierChecker(),
325
-				$this->config->get( 'WBQualityConstraintsAllowedQualifiersConstraintId' )
325
+				$this->config->get('WBQualityConstraintsAllowedQualifiersConstraintId')
326 326
 					=> new QualifiersChecker(
327 327
 						$this->constraintParameterParser,
328 328
 						$this->constraintParameterRenderer
329 329
 					),
330
-				$this->config->get( 'WBQualityConstraintsMandatoryQualifierConstraintId' )
330
+				$this->config->get('WBQualityConstraintsMandatoryQualifierConstraintId')
331 331
 					=> new MandatoryQualifiersChecker(
332 332
 						$this->constraintParameterParser,
333 333
 						$this->constraintParameterRenderer
334 334
 					),
335
-				$this->config->get( 'WBQualityConstraintsRangeConstraintId' )
335
+				$this->config->get('WBQualityConstraintsRangeConstraintId')
336 336
 					=> new RangeChecker(
337 337
 						$this->propertyDataTypeLookup,
338 338
 						$this->constraintParameterParser,
339 339
 						$rangeCheckerHelper,
340 340
 						$this->constraintParameterRenderer
341 341
 					),
342
-				$this->config->get( 'WBQualityConstraintsDifferenceWithinRangeConstraintId' )
342
+				$this->config->get('WBQualityConstraintsDifferenceWithinRangeConstraintId')
343 343
 					=> new DiffWithinRangeChecker(
344 344
 						$this->constraintParameterParser,
345 345
 						$rangeCheckerHelper,
346 346
 						$this->constraintParameterRenderer,
347 347
 						$this->config
348 348
 					),
349
-				$this->config->get( 'WBQualityConstraintsTypeConstraintId' )
349
+				$this->config->get('WBQualityConstraintsTypeConstraintId')
350 350
 					=> new TypeChecker(
351 351
 						$this->lookup,
352 352
 						$this->constraintParameterParser,
353 353
 						$typeCheckerHelper,
354 354
 						$this->config
355 355
 					),
356
-				$this->config->get( 'WBQualityConstraintsValueTypeConstraintId' )
356
+				$this->config->get('WBQualityConstraintsValueTypeConstraintId')
357 357
 					=> new ValueTypeChecker(
358 358
 						$this->lookup,
359 359
 						$this->constraintParameterParser,
@@ -361,47 +361,47 @@  discard block
 block discarded – undo
361 361
 						$typeCheckerHelper,
362 362
 						$this->config
363 363
 					),
364
-				$this->config->get( 'WBQualityConstraintsSingleValueConstraintId' )
364
+				$this->config->get('WBQualityConstraintsSingleValueConstraintId')
365 365
 					=> new SingleValueChecker(),
366
-				$this->config->get( 'WBQualityConstraintsMultiValueConstraintId' )
366
+				$this->config->get('WBQualityConstraintsMultiValueConstraintId')
367 367
 					=> new MultiValueChecker(),
368
-				$this->config->get( 'WBQualityConstraintsDistinctValuesConstraintId' )
368
+				$this->config->get('WBQualityConstraintsDistinctValuesConstraintId')
369 369
 					=> new UniqueValueChecker(
370 370
 						$this->constraintParameterRenderer,
371 371
 						$sparqlHelper
372 372
 					),
373
-				$this->config->get( 'WBQualityConstraintsFormatConstraintId' )
373
+				$this->config->get('WBQualityConstraintsFormatConstraintId')
374 374
 					=> new FormatChecker(
375 375
 						$this->constraintParameterParser,
376 376
 						$this->constraintParameterRenderer,
377 377
 						$this->config,
378 378
 						$sparqlHelper
379 379
 					),
380
-				$this->config->get( 'WBQualityConstraintsCommonsLinkConstraintId' )
380
+				$this->config->get('WBQualityConstraintsCommonsLinkConstraintId')
381 381
 					=> new CommonsLinkChecker(
382 382
 						$this->constraintParameterParser,
383 383
 						$this->constraintParameterRenderer,
384 384
 						$this->titleParser
385 385
 					),
386
-				$this->config->get( 'WBQualityConstraintsOneOfConstraintId' )
386
+				$this->config->get('WBQualityConstraintsOneOfConstraintId')
387 387
 					=> new OneOfChecker(
388 388
 						$this->constraintParameterParser,
389 389
 						$this->constraintParameterRenderer
390 390
 					),
391
-				$this->config->get( 'WBQualityConstraintsUsedForValuesOnlyConstraintId' )
391
+				$this->config->get('WBQualityConstraintsUsedForValuesOnlyConstraintId')
392 392
 					=> new ValueOnlyChecker(),
393
-				$this->config->get( 'WBQualityConstraintsUsedAsReferenceConstraintId' )
393
+				$this->config->get('WBQualityConstraintsUsedAsReferenceConstraintId')
394 394
 					=> new ReferenceChecker(),
395
-				$this->config->get( 'WBQualityConstraintsNoBoundsConstraintId' )
395
+				$this->config->get('WBQualityConstraintsNoBoundsConstraintId')
396 396
 					=> new NoBoundsChecker(),
397
-				$this->config->get( 'WBQualityConstraintsAllowedUnitsConstraintId' )
397
+				$this->config->get('WBQualityConstraintsAllowedUnitsConstraintId')
398 398
 					=> new AllowedUnitsChecker(
399 399
 						$this->constraintParameterParser,
400 400
 						$this->unitConverter
401 401
 					),
402
-				$this->config->get( 'WBQualityConstraintsSingleBestValueConstraintId' )
402
+				$this->config->get('WBQualityConstraintsSingleBestValueConstraintId')
403 403
 					=> new SingleBestValueChecker(),
404
-				$this->config->get( 'WBQualityConstraintsAllowedEntityTypesConstraintId' )
404
+				$this->config->get('WBQualityConstraintsAllowedEntityTypesConstraintId')
405 405
 					=> new EntityTypeChecker(
406 406
 						$this->constraintParameterParser,
407 407
 						$this->constraintParameterRenderer
@@ -416,26 +416,26 @@  discard block
 block discarded – undo
416 416
 	 * @return array[]
417 417
 	 */
418 418
 	public function getConstraintParameterMap() {
419
-		if ( $this->constraintParameterMap === null ) {
419
+		if ($this->constraintParameterMap === null) {
420 420
 			$this->constraintParameterMap = [
421
-				'Commons link' => [ 'namespace' ],
422
-				'Conflicts with' => [ 'property', 'item' ],
423
-				'Diff within range' => [ 'property', 'minimum_quantity', 'maximum_quantity' ],
424
-				'Format' => [ 'pattern' ],
425
-				'Inverse' => [ 'property' ],
426
-				'Item' => [ 'property', 'item' ],
427
-				'Mandatory qualifiers' => [ 'property' ],
421
+				'Commons link' => ['namespace'],
422
+				'Conflicts with' => ['property', 'item'],
423
+				'Diff within range' => ['property', 'minimum_quantity', 'maximum_quantity'],
424
+				'Format' => ['pattern'],
425
+				'Inverse' => ['property'],
426
+				'Item' => ['property', 'item'],
427
+				'Mandatory qualifiers' => ['property'],
428 428
 				'Multi value' => [],
429
-				'One of' => [ 'item' ],
429
+				'One of' => ['item'],
430 430
 				'Qualifier' => [],
431
-				'Qualifiers' => [ 'property' ],
432
-				'Range' => [ 'minimum_quantity', 'maximum_quantity', 'minimum_date', 'maximum_date' ],
431
+				'Qualifiers' => ['property'],
432
+				'Range' => ['minimum_quantity', 'maximum_quantity', 'minimum_date', 'maximum_date'],
433 433
 				'Single value' => [],
434 434
 				'Symmetric' => [],
435
-				'Target required claim' => [ 'property', 'item' ],
436
-				'Type' => [ 'class', 'relation' ],
435
+				'Target required claim' => ['property', 'item'],
436
+				'Type' => ['class', 'relation'],
437 437
 				'Unique value' => [],
438
-				'Value type' => [ 'class', 'relation' ]
438
+				'Value type' => ['class', 'relation']
439 439
 			];
440 440
 		}
441 441
 
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 	 * @return ConstraintRepository
447 447
 	 */
448 448
 	public function getConstraintRepository() {
449
-		if ( $this->constraintRepository === null ) {
449
+		if ($this->constraintRepository === null) {
450 450
 			$this->constraintRepository = new ConstraintRepository();
451 451
 		}
452 452
 
Please login to merge, or discard this patch.
src/ConstraintCheck/Helper/ConstraintParameterParser.php 1 patch
Spacing   +258 added lines, -258 removed lines patch added patch discarded remove patch
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
 	 * @param array $parameters
89 89
 	 * @throws ConstraintParameterException
90 90
 	 */
91
-	public function checkError( array $parameters ) {
92
-		if ( array_key_exists( '@error', $parameters ) ) {
91
+	public function checkError(array $parameters) {
92
+		if (array_key_exists('@error', $parameters)) {
93 93
 			$error = $parameters['@error'];
94
-			if ( array_key_exists( 'toolong', $error ) && $error['toolong'] ) {
94
+			if (array_key_exists('toolong', $error) && $error['toolong']) {
95 95
 				$msg = 'wbqc-violation-message-parameters-error-toolong';
96 96
 			} else {
97 97
 				$msg = 'wbqc-violation-message-parameters-error-unknown';
98 98
 			}
99
-			throw new ConstraintParameterException( new ViolationMessage( $msg ) );
99
+			throw new ConstraintParameterException(new ViolationMessage($msg));
100 100
 		}
101 101
 	}
102 102
 
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 	 * @param string $parameterId
107 107
 	 * @throws ConstraintParameterException
108 108
 	 */
109
-	private function requireSingleParameter( array $parameters, $parameterId ) {
110
-		if ( count( $parameters[$parameterId] ) !== 1 ) {
109
+	private function requireSingleParameter(array $parameters, $parameterId) {
110
+		if (count($parameters[$parameterId]) !== 1) {
111 111
 			throw new ConstraintParameterException(
112
-				( new ViolationMessage( 'wbqc-violation-message-parameter-single' ) )
113
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
112
+				(new ViolationMessage('wbqc-violation-message-parameter-single'))
113
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
114 114
 			);
115 115
 		}
116 116
 	}
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 	 * @return void
123 123
 	 * @throws ConstraintParameterException
124 124
 	 */
125
-	private function requireValueParameter( Snak $snak, $parameterId ) {
126
-		if ( !( $snak instanceof PropertyValueSnak ) ) {
125
+	private function requireValueParameter(Snak $snak, $parameterId) {
126
+		if (!($snak instanceof PropertyValueSnak)) {
127 127
 			throw new ConstraintParameterException(
128
-				( new ViolationMessage( 'wbqc-violation-message-parameter-value' ) )
129
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
128
+				(new ViolationMessage('wbqc-violation-message-parameter-value'))
129
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
130 130
 			);
131 131
 		}
132 132
 	}
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
 	 * @throws ConstraintParameterException
139 139
 	 * @return EntityId
140 140
 	 */
141
-	private function parseEntityIdParameter( array $snakSerialization, $parameterId ) {
142
-		$snak = $this->snakDeserializer->deserialize( $snakSerialization );
143
-		$this->requireValueParameter( $snak, $parameterId );
141
+	private function parseEntityIdParameter(array $snakSerialization, $parameterId) {
142
+		$snak = $this->snakDeserializer->deserialize($snakSerialization);
143
+		$this->requireValueParameter($snak, $parameterId);
144 144
 		$value = $snak->getDataValue();
145
-		if ( $value instanceof EntityIdValue ) {
145
+		if ($value instanceof EntityIdValue) {
146 146
 			return $value->getEntityId();
147 147
 		} else {
148 148
 			throw new ConstraintParameterException(
149
-				( new ViolationMessage( 'wbqc-violation-message-parameter-entity' ) )
150
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
151
-					->withDataValue( $value, Role::CONSTRAINT_PARAMETER_VALUE )
149
+				(new ViolationMessage('wbqc-violation-message-parameter-entity'))
150
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
151
+					->withDataValue($value, Role::CONSTRAINT_PARAMETER_VALUE)
152 152
 			);
153 153
 		}
154 154
 	}
@@ -159,20 +159,20 @@  discard block
 block discarded – undo
159 159
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
160 160
 	 * @return string[] class entity ID serializations
161 161
 	 */
162
-	public function parseClassParameter( array $constraintParameters, $constraintTypeItemId ) {
163
-		$this->checkError( $constraintParameters );
164
-		$classId = $this->config->get( 'WBQualityConstraintsClassId' );
165
-		if ( !array_key_exists( $classId, $constraintParameters ) ) {
162
+	public function parseClassParameter(array $constraintParameters, $constraintTypeItemId) {
163
+		$this->checkError($constraintParameters);
164
+		$classId = $this->config->get('WBQualityConstraintsClassId');
165
+		if (!array_key_exists($classId, $constraintParameters)) {
166 166
 			throw new ConstraintParameterException(
167
-				( new ViolationMessage( 'wbqc-violation-message-parameter-needed' ) )
168
-					->withEntityId( new ItemId( $constraintTypeItemId ), Role::CONSTRAINT_TYPE_ITEM )
169
-					->withEntityId( new PropertyId( $classId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
167
+				(new ViolationMessage('wbqc-violation-message-parameter-needed'))
168
+					->withEntityId(new ItemId($constraintTypeItemId), Role::CONSTRAINT_TYPE_ITEM)
169
+					->withEntityId(new PropertyId($classId), Role::CONSTRAINT_PARAMETER_PROPERTY)
170 170
 			);
171 171
 		}
172 172
 
173 173
 		$classes = [];
174
-		foreach ( $constraintParameters[$classId] as $class ) {
175
-			$classes[] = $this->parseEntityIdParameter( $class, $classId )->getSerialization();
174
+		foreach ($constraintParameters[$classId] as $class) {
175
+			$classes[] = $this->parseEntityIdParameter($class, $classId)->getSerialization();
176 176
 		}
177 177
 		return $classes;
178 178
 	}
@@ -183,23 +183,23 @@  discard block
 block discarded – undo
183 183
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
184 184
 	 * @return string 'instance', 'subclass', or 'instanceOrSubclass'
185 185
 	 */
186
-	public function parseRelationParameter( array $constraintParameters, $constraintTypeItemId ) {
187
-		$this->checkError( $constraintParameters );
188
-		$relationId = $this->config->get( 'WBQualityConstraintsRelationId' );
189
-		if ( !array_key_exists( $relationId, $constraintParameters ) ) {
186
+	public function parseRelationParameter(array $constraintParameters, $constraintTypeItemId) {
187
+		$this->checkError($constraintParameters);
188
+		$relationId = $this->config->get('WBQualityConstraintsRelationId');
189
+		if (!array_key_exists($relationId, $constraintParameters)) {
190 190
 			throw new ConstraintParameterException(
191
-				( new ViolationMessage( 'wbqc-violation-message-parameter-needed' ) )
192
-					->withEntityId( new ItemId( $constraintTypeItemId ), Role::CONSTRAINT_TYPE_ITEM )
193
-					->withEntityId( new PropertyId( $relationId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
191
+				(new ViolationMessage('wbqc-violation-message-parameter-needed'))
192
+					->withEntityId(new ItemId($constraintTypeItemId), Role::CONSTRAINT_TYPE_ITEM)
193
+					->withEntityId(new PropertyId($relationId), Role::CONSTRAINT_PARAMETER_PROPERTY)
194 194
 			);
195 195
 		}
196 196
 
197
-		$this->requireSingleParameter( $constraintParameters, $relationId );
198
-		$relationEntityId = $this->parseEntityIdParameter( $constraintParameters[$relationId][0], $relationId );
199
-		$instanceId = $this->config->get( 'WBQualityConstraintsInstanceOfRelationId' );
200
-		$subclassId = $this->config->get( 'WBQualityConstraintsSubclassOfRelationId' );
201
-		$instanceOrSubclassId = $this->config->get( 'WBQualityConstraintsInstanceOrSubclassOfRelationId' );
202
-		switch ( $relationEntityId ) {
197
+		$this->requireSingleParameter($constraintParameters, $relationId);
198
+		$relationEntityId = $this->parseEntityIdParameter($constraintParameters[$relationId][0], $relationId);
199
+		$instanceId = $this->config->get('WBQualityConstraintsInstanceOfRelationId');
200
+		$subclassId = $this->config->get('WBQualityConstraintsSubclassOfRelationId');
201
+		$instanceOrSubclassId = $this->config->get('WBQualityConstraintsInstanceOrSubclassOfRelationId');
202
+		switch ($relationEntityId) {
203 203
 			case $instanceId:
204 204
 				return 'instance';
205 205
 			case $subclassId:
@@ -208,13 +208,13 @@  discard block
 block discarded – undo
208 208
 				return 'instanceOrSubclass';
209 209
 			default:
210 210
 				throw new ConstraintParameterException(
211
-					( new ViolationMessage( 'wbqc-violation-message-parameter-oneof' ) )
212
-						->withEntityId( new PropertyId( $relationId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
211
+					(new ViolationMessage('wbqc-violation-message-parameter-oneof'))
212
+						->withEntityId(new PropertyId($relationId), Role::CONSTRAINT_PARAMETER_PROPERTY)
213 213
 						->withEntityIdList(
214 214
 							[
215
-								new ItemId( $instanceId ),
216
-								new ItemId( $subclassId ),
217
-								new ItemId( $instanceOrSubclassId ),
215
+								new ItemId($instanceId),
216
+								new ItemId($subclassId),
217
+								new ItemId($instanceOrSubclassId),
218 218
 							],
219 219
 							Role::CONSTRAINT_PARAMETER_VALUE
220 220
 						)
@@ -229,20 +229,20 @@  discard block
 block discarded – undo
229 229
 	 * @throws ConstraintParameterException
230 230
 	 * @return PropertyId
231 231
 	 */
232
-	private function parsePropertyIdParameter( array $snakSerialization, $parameterId ) {
233
-		$snak = $this->snakDeserializer->deserialize( $snakSerialization );
234
-		$this->requireValueParameter( $snak, $parameterId );
232
+	private function parsePropertyIdParameter(array $snakSerialization, $parameterId) {
233
+		$snak = $this->snakDeserializer->deserialize($snakSerialization);
234
+		$this->requireValueParameter($snak, $parameterId);
235 235
 		$value = $snak->getDataValue();
236
-		if ( $value instanceof EntityIdValue ) {
236
+		if ($value instanceof EntityIdValue) {
237 237
 			$id = $value->getEntityId();
238
-			if ( $id instanceof PropertyId ) {
238
+			if ($id instanceof PropertyId) {
239 239
 				return $id;
240 240
 			}
241 241
 		}
242 242
 		throw new ConstraintParameterException(
243
-			( new ViolationMessage( 'wbqc-violation-message-parameter-property' ) )
244
-				->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
245
-				->withDataValue( $value, Role::CONSTRAINT_PARAMETER_VALUE )
243
+			(new ViolationMessage('wbqc-violation-message-parameter-property'))
244
+				->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
245
+				->withDataValue($value, Role::CONSTRAINT_PARAMETER_VALUE)
246 246
 		);
247 247
 	}
248 248
 
@@ -253,32 +253,32 @@  discard block
 block discarded – undo
253 253
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
254 254
 	 * @return PropertyId
255 255
 	 */
256
-	public function parsePropertyParameter( array $constraintParameters, $constraintTypeItemId ) {
257
-		$this->checkError( $constraintParameters );
258
-		$propertyId = $this->config->get( 'WBQualityConstraintsPropertyId' );
259
-		if ( !array_key_exists( $propertyId, $constraintParameters ) ) {
256
+	public function parsePropertyParameter(array $constraintParameters, $constraintTypeItemId) {
257
+		$this->checkError($constraintParameters);
258
+		$propertyId = $this->config->get('WBQualityConstraintsPropertyId');
259
+		if (!array_key_exists($propertyId, $constraintParameters)) {
260 260
 			throw new ConstraintParameterException(
261
-				( new ViolationMessage( 'wbqc-violation-message-parameter-needed' ) )
262
-					->withEntityId( new ItemId( $constraintTypeItemId ), Role::CONSTRAINT_TYPE_ITEM )
263
-					->withEntityId( new PropertyId( $propertyId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
261
+				(new ViolationMessage('wbqc-violation-message-parameter-needed'))
262
+					->withEntityId(new ItemId($constraintTypeItemId), Role::CONSTRAINT_TYPE_ITEM)
263
+					->withEntityId(new PropertyId($propertyId), Role::CONSTRAINT_PARAMETER_PROPERTY)
264 264
 			);
265 265
 		}
266 266
 
267
-		$this->requireSingleParameter( $constraintParameters, $propertyId );
268
-		return $this->parsePropertyIdParameter( $constraintParameters[$propertyId][0], $propertyId );
267
+		$this->requireSingleParameter($constraintParameters, $propertyId);
268
+		return $this->parsePropertyIdParameter($constraintParameters[$propertyId][0], $propertyId);
269 269
 	}
270 270
 
271
-	private function parseItemIdParameter( PropertyValueSnak $snak, $parameterId ) {
271
+	private function parseItemIdParameter(PropertyValueSnak $snak, $parameterId) {
272 272
 		$dataValue = $snak->getDataValue();
273
-		if ( $dataValue instanceof EntityIdValue &&
273
+		if ($dataValue instanceof EntityIdValue &&
274 274
 			$dataValue->getEntityId() instanceof ItemId
275 275
 		) {
276
-			return ItemIdSnakValue::fromItemId( $dataValue->getEntityId() );
276
+			return ItemIdSnakValue::fromItemId($dataValue->getEntityId());
277 277
 		} else {
278 278
 			throw new ConstraintParameterException(
279
-				( new ViolationMessage( 'wbqc-violation-message-parameter-item' ) )
280
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
281
-					->withDataValue( $dataValue, Role::CONSTRAINT_PARAMETER_VALUE )
279
+				(new ViolationMessage('wbqc-violation-message-parameter-item'))
280
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
281
+					->withDataValue($dataValue, Role::CONSTRAINT_PARAMETER_VALUE)
282 282
 			);
283 283
 		}
284 284
 	}
@@ -290,15 +290,15 @@  discard block
 block discarded – undo
290 290
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
291 291
 	 * @return ItemIdSnakValue[] array of values
292 292
 	 */
293
-	public function parseItemsParameter( array $constraintParameters, $constraintTypeItemId, $required ) {
294
-		$this->checkError( $constraintParameters );
295
-		$qualifierId = $this->config->get( 'WBQualityConstraintsQualifierOfPropertyConstraintId' );
296
-		if ( !array_key_exists( $qualifierId, $constraintParameters ) ) {
297
-			if ( $required ) {
293
+	public function parseItemsParameter(array $constraintParameters, $constraintTypeItemId, $required) {
294
+		$this->checkError($constraintParameters);
295
+		$qualifierId = $this->config->get('WBQualityConstraintsQualifierOfPropertyConstraintId');
296
+		if (!array_key_exists($qualifierId, $constraintParameters)) {
297
+			if ($required) {
298 298
 				throw new ConstraintParameterException(
299
-					( new ViolationMessage( 'wbqc-violation-message-parameter-needed' ) )
300
-						->withEntityId( new ItemId( $constraintTypeItemId ), Role::CONSTRAINT_TYPE_ITEM )
301
-						->withEntityId( new PropertyId( $qualifierId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
299
+					(new ViolationMessage('wbqc-violation-message-parameter-needed'))
300
+						->withEntityId(new ItemId($constraintTypeItemId), Role::CONSTRAINT_TYPE_ITEM)
301
+						->withEntityId(new PropertyId($qualifierId), Role::CONSTRAINT_PARAMETER_PROPERTY)
302 302
 				);
303 303
 			} else {
304 304
 				return [];
@@ -306,11 +306,11 @@  discard block
 block discarded – undo
306 306
 		}
307 307
 
308 308
 		$values = [];
309
-		foreach ( $constraintParameters[$qualifierId] as $parameter ) {
310
-			$snak = $this->snakDeserializer->deserialize( $parameter );
311
-			switch ( true ) {
309
+		foreach ($constraintParameters[$qualifierId] as $parameter) {
310
+			$snak = $this->snakDeserializer->deserialize($parameter);
311
+			switch (true) {
312 312
 				case $snak instanceof PropertyValueSnak:
313
-					$values[] = $this->parseItemIdParameter( $snak, $qualifierId );
313
+					$values[] = $this->parseItemIdParameter($snak, $qualifierId);
314 314
 					break;
315 315
 				case $snak instanceof PropertySomeValueSnak:
316 316
 					$values[] = ItemIdSnakValue::someValue();
@@ -329,27 +329,27 @@  discard block
 block discarded – undo
329 329
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
330 330
 	 * @return PropertyId[]
331 331
 	 */
332
-	public function parsePropertiesParameter( array $constraintParameters, $constraintTypeItemId ) {
333
-		$this->checkError( $constraintParameters );
334
-		$propertyId = $this->config->get( 'WBQualityConstraintsPropertyId' );
335
-		if ( !array_key_exists( $propertyId, $constraintParameters ) ) {
332
+	public function parsePropertiesParameter(array $constraintParameters, $constraintTypeItemId) {
333
+		$this->checkError($constraintParameters);
334
+		$propertyId = $this->config->get('WBQualityConstraintsPropertyId');
335
+		if (!array_key_exists($propertyId, $constraintParameters)) {
336 336
 			throw new ConstraintParameterException(
337
-				( new ViolationMessage( 'wbqc-violation-message-parameter-needed' ) )
338
-					->withEntityId( new ItemId( $constraintTypeItemId ), Role::CONSTRAINT_TYPE_ITEM )
339
-					->withEntityId( new PropertyId( $propertyId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
337
+				(new ViolationMessage('wbqc-violation-message-parameter-needed'))
338
+					->withEntityId(new ItemId($constraintTypeItemId), Role::CONSTRAINT_TYPE_ITEM)
339
+					->withEntityId(new PropertyId($propertyId), Role::CONSTRAINT_PARAMETER_PROPERTY)
340 340
 			);
341 341
 		}
342 342
 
343 343
 		$parameters = $constraintParameters[$propertyId];
344
-		if ( count( $parameters ) === 1 &&
345
-			$this->snakDeserializer->deserialize( $parameters[0] ) instanceof PropertyNoValueSnak
344
+		if (count($parameters) === 1 &&
345
+			$this->snakDeserializer->deserialize($parameters[0]) instanceof PropertyNoValueSnak
346 346
 		) {
347 347
 			return [];
348 348
 		}
349 349
 
350 350
 		$properties = [];
351
-		foreach ( $parameters as $parameter ) {
352
-			$properties[] = $this->parsePropertyIdParameter( $parameter, $propertyId );
351
+		foreach ($parameters as $parameter) {
352
+			$properties[] = $this->parsePropertyIdParameter($parameter, $propertyId);
353 353
 		}
354 354
 		return $properties;
355 355
 	}
@@ -360,16 +360,16 @@  discard block
 block discarded – undo
360 360
 	 * @throws ConstraintParameterException
361 361
 	 * @return DataValue|null
362 362
 	 */
363
-	private function parseValueOrNoValueParameter( array $snakSerialization, $parameterId ) {
364
-		$snak = $this->snakDeserializer->deserialize( $snakSerialization );
365
-		if ( $snak instanceof PropertyValueSnak ) {
363
+	private function parseValueOrNoValueParameter(array $snakSerialization, $parameterId) {
364
+		$snak = $this->snakDeserializer->deserialize($snakSerialization);
365
+		if ($snak instanceof PropertyValueSnak) {
366 366
 			return $snak->getDataValue();
367
-		} elseif ( $snak instanceof PropertyNoValueSnak ) {
367
+		} elseif ($snak instanceof PropertyNoValueSnak) {
368 368
 			return null;
369 369
 		} else {
370 370
 			throw new ConstraintParameterException(
371
-				( new ViolationMessage( 'wbqc-violation-message-parameter-value-or-novalue' ) )
372
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
371
+				(new ViolationMessage('wbqc-violation-message-parameter-value-or-novalue'))
372
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
373 373
 			);
374 374
 		}
375 375
 	}
@@ -379,10 +379,10 @@  discard block
 block discarded – undo
379 379
 	 * @param string $parameterId
380 380
 	 * @return DataValue|null
381 381
 	 */
382
-	private function parseValueOrNoValueOrNowParameter( array $snakSerialization, $parameterId ) {
382
+	private function parseValueOrNoValueOrNowParameter(array $snakSerialization, $parameterId) {
383 383
 		try {
384
-			return $this->parseValueOrNoValueParameter( $snakSerialization, $parameterId );
385
-		} catch ( ConstraintParameterException $e ) {
384
+			return $this->parseValueOrNoValueParameter($snakSerialization, $parameterId);
385
+		} catch (ConstraintParameterException $e) {
386 386
 			// unknown value means “now”
387 387
 			return new NowValue();
388 388
 		}
@@ -395,14 +395,14 @@  discard block
 block discarded – undo
395 395
 	 * @param string $unit
396 396
 	 * @return bool
397 397
 	 */
398
-	private function exactlyOneQuantityWithUnit( DataValue $min = null, DataValue $max = null, $unit ) {
399
-		if ( !( $min instanceof UnboundedQuantityValue ) ||
400
-			!( $max instanceof UnboundedQuantityValue )
398
+	private function exactlyOneQuantityWithUnit(DataValue $min = null, DataValue $max = null, $unit) {
399
+		if (!($min instanceof UnboundedQuantityValue) ||
400
+			!($max instanceof UnboundedQuantityValue)
401 401
 		) {
402 402
 			return false;
403 403
 		}
404 404
 
405
-		return ( $min->getUnit() === $unit ) !== ( $max->getUnit() === $unit );
405
+		return ($min->getUnit() === $unit) !== ($max->getUnit() === $unit);
406 406
 	}
407 407
 
408 408
 	/**
@@ -415,42 +415,42 @@  discard block
 block discarded – undo
415 415
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
416 416
 	 * @return DataValue[] if the parameter is invalid or missing
417 417
 	 */
418
-	private function parseRangeParameter( array $constraintParameters, $minimumId, $maximumId, $constraintTypeItemId, $type ) {
419
-		$this->checkError( $constraintParameters );
420
-		if ( !array_key_exists( $minimumId, $constraintParameters ) ||
421
-			!array_key_exists( $maximumId, $constraintParameters )
418
+	private function parseRangeParameter(array $constraintParameters, $minimumId, $maximumId, $constraintTypeItemId, $type) {
419
+		$this->checkError($constraintParameters);
420
+		if (!array_key_exists($minimumId, $constraintParameters) ||
421
+			!array_key_exists($maximumId, $constraintParameters)
422 422
 		) {
423 423
 			throw new ConstraintParameterException(
424
-				( new ViolationMessage( 'wbqc-violation-message-range-parameters-needed' ) )
425
-					->withDataValueType( $type )
426
-					->withEntityId( new PropertyId( $minimumId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
427
-					->withEntityId( new PropertyId( $maximumId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
428
-					->withEntityId( new ItemId( $constraintTypeItemId ), Role::CONSTRAINT_TYPE_ITEM )
424
+				(new ViolationMessage('wbqc-violation-message-range-parameters-needed'))
425
+					->withDataValueType($type)
426
+					->withEntityId(new PropertyId($minimumId), Role::CONSTRAINT_PARAMETER_PROPERTY)
427
+					->withEntityId(new PropertyId($maximumId), Role::CONSTRAINT_PARAMETER_PROPERTY)
428
+					->withEntityId(new ItemId($constraintTypeItemId), Role::CONSTRAINT_TYPE_ITEM)
429 429
 			);
430 430
 		}
431 431
 
432
-		$this->requireSingleParameter( $constraintParameters, $minimumId );
433
-		$this->requireSingleParameter( $constraintParameters, $maximumId );
432
+		$this->requireSingleParameter($constraintParameters, $minimumId);
433
+		$this->requireSingleParameter($constraintParameters, $maximumId);
434 434
 		$parseFunction = $type === 'time' ? 'parseValueOrNoValueOrNowParameter' : 'parseValueOrNoValueParameter';
435
-		$min = $this->$parseFunction( $constraintParameters[$minimumId][0], $minimumId );
436
-		$max = $this->$parseFunction( $constraintParameters[$maximumId][0], $maximumId );
435
+		$min = $this->$parseFunction($constraintParameters[$minimumId][0], $minimumId);
436
+		$max = $this->$parseFunction($constraintParameters[$maximumId][0], $maximumId);
437 437
 
438
-		$yearUnit = $this->config->get( 'WBQualityConstraintsYearUnit' );
439
-		if ( $this->exactlyOneQuantityWithUnit( $min, $max, $yearUnit ) ) {
438
+		$yearUnit = $this->config->get('WBQualityConstraintsYearUnit');
439
+		if ($this->exactlyOneQuantityWithUnit($min, $max, $yearUnit)) {
440 440
 			throw new ConstraintParameterException(
441
-				new ViolationMessage( 'wbqc-violation-message-range-parameters-one-year' )
441
+				new ViolationMessage('wbqc-violation-message-range-parameters-one-year')
442 442
 			);
443 443
 		}
444
-		if ( $min === null && $max === null ||
445
-			$min !== null && $max !== null && $min->equals( $max ) ) {
444
+		if ($min === null && $max === null ||
445
+			$min !== null && $max !== null && $min->equals($max)) {
446 446
 			throw new ConstraintParameterException(
447
-				( new ViolationMessage( 'wbqc-violation-message-range-parameters-same' ) )
448
-					->withEntityId( new PropertyId( $minimumId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
449
-					->withEntityId( new PropertyId( $maximumId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
447
+				(new ViolationMessage('wbqc-violation-message-range-parameters-same'))
448
+					->withEntityId(new PropertyId($minimumId), Role::CONSTRAINT_PARAMETER_PROPERTY)
449
+					->withEntityId(new PropertyId($maximumId), Role::CONSTRAINT_PARAMETER_PROPERTY)
450 450
 			);
451 451
 		}
452 452
 
453
-		return [ $min, $max ];
453
+		return [$min, $max];
454 454
 	}
455 455
 
456 456
 	/**
@@ -460,11 +460,11 @@  discard block
 block discarded – undo
460 460
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
461 461
 	 * @return DataValue[] a pair of two data values, either of which may be null to signify an open range
462 462
 	 */
463
-	public function parseQuantityRangeParameter( array $constraintParameters, $constraintTypeItemId ) {
463
+	public function parseQuantityRangeParameter(array $constraintParameters, $constraintTypeItemId) {
464 464
 		return $this->parseRangeParameter(
465 465
 			$constraintParameters,
466
-			$this->config->get( 'WBQualityConstraintsMinimumQuantityId' ),
467
-			$this->config->get( 'WBQualityConstraintsMaximumQuantityId' ),
466
+			$this->config->get('WBQualityConstraintsMinimumQuantityId'),
467
+			$this->config->get('WBQualityConstraintsMaximumQuantityId'),
468 468
 			$constraintTypeItemId,
469 469
 			'quantity'
470 470
 		);
@@ -477,11 +477,11 @@  discard block
 block discarded – undo
477 477
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
478 478
 	 * @return DataValue[] a pair of two data values, either of which may be null to signify an open range
479 479
 	 */
480
-	public function parseTimeRangeParameter( array $constraintParameters, $constraintTypeItemId ) {
480
+	public function parseTimeRangeParameter(array $constraintParameters, $constraintTypeItemId) {
481 481
 		return $this->parseRangeParameter(
482 482
 			$constraintParameters,
483
-			$this->config->get( 'WBQualityConstraintsMinimumDateId' ),
484
-			$this->config->get( 'WBQualityConstraintsMaximumDateId' ),
483
+			$this->config->get('WBQualityConstraintsMinimumDateId'),
484
+			$this->config->get('WBQualityConstraintsMaximumDateId'),
485 485
 			$constraintTypeItemId,
486 486
 			'time'
487 487
 		);
@@ -494,17 +494,17 @@  discard block
 block discarded – undo
494 494
 	 * @throws ConstraintParameterException
495 495
 	 * @return string
496 496
 	 */
497
-	private function parseStringParameter( array $snakSerialization, $parameterId ) {
498
-		$snak = $this->snakDeserializer->deserialize( $snakSerialization );
499
-		$this->requireValueParameter( $snak, $parameterId );
497
+	private function parseStringParameter(array $snakSerialization, $parameterId) {
498
+		$snak = $this->snakDeserializer->deserialize($snakSerialization);
499
+		$this->requireValueParameter($snak, $parameterId);
500 500
 		$value = $snak->getDataValue();
501
-		if ( $value instanceof StringValue ) {
501
+		if ($value instanceof StringValue) {
502 502
 			return $value->getValue();
503 503
 		} else {
504 504
 			throw new ConstraintParameterException(
505
-				( new ViolationMessage( 'wbqc-violation-message-parameter-string' ) )
506
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
507
-					->withDataValue( $value, Role::CONSTRAINT_PARAMETER_VALUE )
505
+				(new ViolationMessage('wbqc-violation-message-parameter-string'))
506
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
507
+					->withDataValue($value, Role::CONSTRAINT_PARAMETER_VALUE)
508 508
 			);
509 509
 		}
510 510
 	}
@@ -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,19 +532,19 @@  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
-				( new ViolationMessage( 'wbqc-violation-message-parameter-needed' ) )
541
-					->withEntityId( new ItemId( $constraintTypeItemId ), Role::CONSTRAINT_TYPE_ITEM )
542
-					->withEntityId( new PropertyId( $formatId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
540
+				(new ViolationMessage('wbqc-violation-message-parameter-needed'))
541
+					->withEntityId(new ItemId($constraintTypeItemId), Role::CONSTRAINT_TYPE_ITEM)
542
+					->withEntityId(new PropertyId($formatId), Role::CONSTRAINT_PARAMETER_PROPERTY)
543 543
 			);
544 544
 		}
545 545
 
546
-		$this->requireSingleParameter( $constraintParameters, $formatId );
547
-		return $this->parseStringParameter( $constraintParameters[$formatId][0], $formatId );
546
+		$this->requireSingleParameter($constraintParameters, $formatId);
547
+		return $this->parseStringParameter($constraintParameters[$formatId][0], $formatId);
548 548
 	}
549 549
 
550 550
 	/**
@@ -552,16 +552,16 @@  discard block
 block discarded – undo
552 552
 	 * @throws ConstraintParameterException if the parameter is invalid
553 553
 	 * @return EntityId[]
554 554
 	 */
555
-	public function parseExceptionParameter( array $constraintParameters ) {
556
-		$this->checkError( $constraintParameters );
557
-		$exceptionId = $this->config->get( 'WBQualityConstraintsExceptionToConstraintId' );
558
-		if ( !array_key_exists( $exceptionId, $constraintParameters ) ) {
555
+	public function parseExceptionParameter(array $constraintParameters) {
556
+		$this->checkError($constraintParameters);
557
+		$exceptionId = $this->config->get('WBQualityConstraintsExceptionToConstraintId');
558
+		if (!array_key_exists($exceptionId, $constraintParameters)) {
559 559
 			return [];
560 560
 		}
561 561
 
562 562
 		return array_map(
563
-			function( $snakSerialization ) use ( $exceptionId ) {
564
-				return $this->parseEntityIdParameter( $snakSerialization, $exceptionId );
563
+			function($snakSerialization) use ($exceptionId) {
564
+				return $this->parseEntityIdParameter($snakSerialization, $exceptionId);
565 565
 			},
566 566
 			$constraintParameters[$exceptionId]
567 567
 		);
@@ -572,26 +572,26 @@  discard block
 block discarded – undo
572 572
 	 * @throws ConstraintParameterException if the parameter is invalid
573 573
 	 * @return string|null 'mandatory' or null
574 574
 	 */
575
-	public function parseConstraintStatusParameter( array $constraintParameters ) {
576
-		$this->checkError( $constraintParameters );
577
-		$constraintStatusId = $this->config->get( 'WBQualityConstraintsConstraintStatusId' );
578
-		if ( !array_key_exists( $constraintStatusId, $constraintParameters ) ) {
575
+	public function parseConstraintStatusParameter(array $constraintParameters) {
576
+		$this->checkError($constraintParameters);
577
+		$constraintStatusId = $this->config->get('WBQualityConstraintsConstraintStatusId');
578
+		if (!array_key_exists($constraintStatusId, $constraintParameters)) {
579 579
 			return null;
580 580
 		}
581 581
 
582
-		$mandatoryId = $this->config->get( 'WBQualityConstraintsMandatoryConstraintId' );
583
-		$this->requireSingleParameter( $constraintParameters, $constraintStatusId );
584
-		$snak = $this->snakDeserializer->deserialize( $constraintParameters[$constraintStatusId][0] );
585
-		$this->requireValueParameter( $snak, $constraintStatusId );
582
+		$mandatoryId = $this->config->get('WBQualityConstraintsMandatoryConstraintId');
583
+		$this->requireSingleParameter($constraintParameters, $constraintStatusId);
584
+		$snak = $this->snakDeserializer->deserialize($constraintParameters[$constraintStatusId][0]);
585
+		$this->requireValueParameter($snak, $constraintStatusId);
586 586
 		$statusId = $snak->getDataValue()->getEntityId()->getSerialization();
587 587
 
588
-		if ( $statusId === $mandatoryId ) {
588
+		if ($statusId === $mandatoryId) {
589 589
 			return 'mandatory';
590 590
 		} else {
591 591
 			throw new ConstraintParameterException(
592
-				( new ViolationMessage( 'wbqc-violation-message-parameter-oneof' ) )
593
-					->withEntityId( new PropertyId( $constraintStatusId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
594
-					->withEntityIdList( [ new ItemId( $mandatoryId ) ], Role::CONSTRAINT_PARAMETER_VALUE )
592
+				(new ViolationMessage('wbqc-violation-message-parameter-oneof'))
593
+					->withEntityId(new PropertyId($constraintStatusId), Role::CONSTRAINT_PARAMETER_PROPERTY)
594
+					->withEntityIdList([new ItemId($mandatoryId)], Role::CONSTRAINT_PARAMETER_VALUE)
595 595
 			);
596 596
 		}
597 597
 	}
@@ -603,12 +603,12 @@  discard block
 block discarded – undo
603 603
 	 * @return void
604 604
 	 * @throws ConstraintParameterException
605 605
 	 */
606
-	private function requireMonolingualTextParameter( DataValue $dataValue, $parameterId ) {
607
-		if ( !( $dataValue instanceof MonolingualTextValue ) ) {
606
+	private function requireMonolingualTextParameter(DataValue $dataValue, $parameterId) {
607
+		if (!($dataValue instanceof MonolingualTextValue)) {
608 608
 			throw new ConstraintParameterException(
609
-				( new ViolationMessage( 'wbqc-violation-message-parameter-monolingualtext' ) )
610
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
611
-					->withDataValue( $dataValue, Role::CONSTRAINT_PARAMETER_VALUE )
609
+				(new ViolationMessage('wbqc-violation-message-parameter-monolingualtext'))
610
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
611
+					->withDataValue($dataValue, Role::CONSTRAINT_PARAMETER_VALUE)
612 612
 			);
613 613
 		}
614 614
 	}
@@ -621,30 +621,30 @@  discard block
 block discarded – undo
621 621
 	 * @throws ConstraintParameterException if invalid snaks are found or a language has multiple texts
622 622
 	 * @return MultilingualTextValue
623 623
 	 */
624
-	private function parseMultilingualTextParameter( array $snakSerializations, $parameterId ) {
624
+	private function parseMultilingualTextParameter(array $snakSerializations, $parameterId) {
625 625
 		$result = [];
626 626
 
627
-		foreach ( $snakSerializations as $snakSerialization ) {
628
-			$snak = $this->snakDeserializer->deserialize( $snakSerialization );
629
-			$this->requireValueParameter( $snak, $parameterId );
627
+		foreach ($snakSerializations as $snakSerialization) {
628
+			$snak = $this->snakDeserializer->deserialize($snakSerialization);
629
+			$this->requireValueParameter($snak, $parameterId);
630 630
 
631 631
 			$value = $snak->getDataValue();
632
-			$this->requireMonolingualTextParameter( $value, $parameterId );
632
+			$this->requireMonolingualTextParameter($value, $parameterId);
633 633
 			/** @var MonolingualTextValue $value */
634 634
 
635 635
 			$code = $value->getLanguageCode();
636
-			if ( array_key_exists( $code, $result ) ) {
636
+			if (array_key_exists($code, $result)) {
637 637
 				throw new ConstraintParameterException(
638
-					( new ViolationMessage( 'wbqc-violation-message-parameter-single-per-language' ) )
639
-						->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
640
-						->withLanguage( $code )
638
+					(new ViolationMessage('wbqc-violation-message-parameter-single-per-language'))
639
+						->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
640
+						->withLanguage($code)
641 641
 				);
642 642
 			}
643 643
 
644 644
 			$result[$code] = $value;
645 645
 		}
646 646
 
647
-		return new MultilingualTextValue( $result );
647
+		return new MultilingualTextValue($result);
648 648
 	}
649 649
 
650 650
 	/**
@@ -652,11 +652,11 @@  discard block
 block discarded – undo
652 652
 	 * @throws ConstraintParameterException if the parameter is invalid
653 653
 	 * @return MultilingualTextValue
654 654
 	 */
655
-	public function parseSyntaxClarificationParameter( array $constraintParameters ) {
656
-		$syntaxClarificationId = $this->config->get( 'WBQualityConstraintsSyntaxClarificationId' );
655
+	public function parseSyntaxClarificationParameter(array $constraintParameters) {
656
+		$syntaxClarificationId = $this->config->get('WBQualityConstraintsSyntaxClarificationId');
657 657
 
658
-		if ( !array_key_exists( $syntaxClarificationId, $constraintParameters ) ) {
659
-			return new MultilingualTextValue( [] );
658
+		if (!array_key_exists($syntaxClarificationId, $constraintParameters)) {
659
+			return new MultilingualTextValue([]);
660 660
 		}
661 661
 
662 662
 		$syntaxClarifications = $this->parseMultilingualTextParameter(
@@ -675,20 +675,20 @@  discard block
 block discarded – undo
675 675
 	 * @throws ConstraintParameterException if the parameter is invalid
676 676
 	 * @return string[]|null Context::TYPE_* constants
677 677
 	 */
678
-	public function parseConstraintScopeParameter( array $constraintParameters, $constraintTypeItemId, array $validScopes = null ) {
679
-		$constraintScopeId = $this->config->get( 'WBQualityConstraintsConstraintScopeId' );
680
-		$mainSnakId = $this->config->get( 'WBQualityConstraintsConstraintCheckedOnMainValueId' );
681
-		$qualifiersId = $this->config->get( 'WBQualityConstraintsConstraintCheckedOnQualifiersId' );
682
-		$referencesId = $this->config->get( 'WBQualityConstraintsConstraintCheckedOnReferencesId' );
678
+	public function parseConstraintScopeParameter(array $constraintParameters, $constraintTypeItemId, array $validScopes = null) {
679
+		$constraintScopeId = $this->config->get('WBQualityConstraintsConstraintScopeId');
680
+		$mainSnakId = $this->config->get('WBQualityConstraintsConstraintCheckedOnMainValueId');
681
+		$qualifiersId = $this->config->get('WBQualityConstraintsConstraintCheckedOnQualifiersId');
682
+		$referencesId = $this->config->get('WBQualityConstraintsConstraintCheckedOnReferencesId');
683 683
 
684
-		if ( !array_key_exists( $constraintScopeId, $constraintParameters ) ) {
684
+		if (!array_key_exists($constraintScopeId, $constraintParameters)) {
685 685
 			return null;
686 686
 		}
687 687
 
688 688
 		$contextTypes = [];
689
-		foreach ( $constraintParameters[$constraintScopeId] as $snakSerialization ) {
690
-			$scopeEntityId = $this->parseEntityIdParameter( $snakSerialization, $constraintScopeId );
691
-			switch ( $scopeEntityId->getSerialization() ) {
689
+		foreach ($constraintParameters[$constraintScopeId] as $snakSerialization) {
690
+			$scopeEntityId = $this->parseEntityIdParameter($snakSerialization, $constraintScopeId);
691
+			switch ($scopeEntityId->getSerialization()) {
692 692
 				case $mainSnakId:
693 693
 					$contextTypes[] = Context::TYPE_STATEMENT;
694 694
 					break;
@@ -700,13 +700,13 @@  discard block
 block discarded – undo
700 700
 					break;
701 701
 				default:
702 702
 					throw new ConstraintParameterException(
703
-						( new ViolationMessage( 'wbqc-violation-message-parameter-oneof' ) )
704
-							->withEntityId( new PropertyId( $constraintScopeId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
703
+						(new ViolationMessage('wbqc-violation-message-parameter-oneof'))
704
+							->withEntityId(new PropertyId($constraintScopeId), Role::CONSTRAINT_PARAMETER_PROPERTY)
705 705
 							->withEntityIdList(
706 706
 								[
707
-									new ItemId( $mainSnakId ),
708
-									new ItemId( $qualifiersId ),
709
-									new ItemId( $referencesId ),
707
+									new ItemId($mainSnakId),
708
+									new ItemId($qualifiersId),
709
+									new ItemId($referencesId),
710 710
 								],
711 711
 								Role::CONSTRAINT_PARAMETER_VALUE
712 712
 							)
@@ -714,15 +714,15 @@  discard block
 block discarded – undo
714 714
 			}
715 715
 		}
716 716
 
717
-		if ( $validScopes !== null ) {
718
-			$invalidScopes = array_diff( $contextTypes, $validScopes );
719
-			if ( $invalidScopes !== [] ) {
720
-				$invalidScope = array_pop( $invalidScopes );
717
+		if ($validScopes !== null) {
718
+			$invalidScopes = array_diff($contextTypes, $validScopes);
719
+			if ($invalidScopes !== []) {
720
+				$invalidScope = array_pop($invalidScopes);
721 721
 				throw new ConstraintParameterException(
722
-					( new ViolationMessage( 'wbqc-violation-message-invalid-scope' ) )
723
-						->withConstraintScope( $invalidScope, Role::CONSTRAINT_PARAMETER_VALUE )
724
-						->withEntityId( new ItemId( $constraintTypeItemId ), Role::CONSTRAINT_TYPE_ITEM )
725
-						->withConstraintScopeList( $validScopes, Role::CONSTRAINT_PARAMETER_VALUE )
722
+					(new ViolationMessage('wbqc-violation-message-invalid-scope'))
723
+						->withConstraintScope($invalidScope, Role::CONSTRAINT_PARAMETER_VALUE)
724
+						->withEntityId(new ItemId($constraintTypeItemId), Role::CONSTRAINT_TYPE_ITEM)
725
+						->withConstraintScopeList($validScopes, Role::CONSTRAINT_PARAMETER_VALUE)
726 726
 				);
727 727
 			}
728 728
 		}
@@ -736,15 +736,15 @@  discard block
 block discarded – undo
736 736
 	 * @param ItemId $unitId
737 737
 	 * @return string unit
738 738
 	 */
739
-	private function parseUnitParameter( ItemId $unitId ) {
739
+	private function parseUnitParameter(ItemId $unitId) {
740 740
 		$unitRepositoryName = $unitId->getRepositoryName();
741
-		if ( !array_key_exists( $unitRepositoryName, $this->conceptBaseUris ) ) {
741
+		if (!array_key_exists($unitRepositoryName, $this->conceptBaseUris)) {
742 742
 			throw new LogicException(
743
-				'No base URI for concept URI for repository: ' . $unitRepositoryName
743
+				'No base URI for concept URI for repository: '.$unitRepositoryName
744 744
 			);
745 745
 		}
746 746
 		$baseUri = $this->conceptBaseUris[$unitRepositoryName];
747
-		return $baseUri . $unitId->getSerialization();
747
+		return $baseUri.$unitId->getSerialization();
748 748
 	}
749 749
 
750 750
 	/**
@@ -754,23 +754,23 @@  discard block
 block discarded – undo
754 754
 	 * @return UnitsParameter
755 755
 	 * @throws ConstraintParameterException
756 756
 	 */
757
-	private function parseUnitItem( ItemIdSnakValue $item ) {
758
-		switch ( true ) {
757
+	private function parseUnitItem(ItemIdSnakValue $item) {
758
+		switch (true) {
759 759
 			case $item->isValue():
760
-				$unit = $this->parseUnitParameter( $item->getItemId() );
760
+				$unit = $this->parseUnitParameter($item->getItemId());
761 761
 				return new UnitsParameter(
762
-					[ $item->getItemId() ],
763
-					[ UnboundedQuantityValue::newFromNumber( 1, $unit ) ],
762
+					[$item->getItemId()],
763
+					[UnboundedQuantityValue::newFromNumber(1, $unit)],
764 764
 					false
765 765
 				);
766 766
 			case $item->isSomeValue():
767
-				$qualifierId = $this->config->get( 'WBQualityConstraintsQualifierOfPropertyConstraintId' );
767
+				$qualifierId = $this->config->get('WBQualityConstraintsQualifierOfPropertyConstraintId');
768 768
 				throw new ConstraintParameterException(
769
-					( new ViolationMessage( 'wbqc-violation-message-parameter-value-or-novalue' ) )
770
-						->withEntityId( new PropertyId( $qualifierId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
769
+					(new ViolationMessage('wbqc-violation-message-parameter-value-or-novalue'))
770
+						->withEntityId(new PropertyId($qualifierId), Role::CONSTRAINT_PARAMETER_PROPERTY)
771 771
 				);
772 772
 			case $item->isNoValue():
773
-				return new UnitsParameter( [], [], true );
773
+				return new UnitsParameter([], [], true);
774 774
 		}
775 775
 	}
776 776
 
@@ -780,26 +780,26 @@  discard block
 block discarded – undo
780 780
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
781 781
 	 * @return UnitsParameter
782 782
 	 */
783
-	public function parseUnitsParameter( array $constraintParameters, $constraintTypeItemId ) {
784
-		$items = $this->parseItemsParameter( $constraintParameters, $constraintTypeItemId, true );
783
+	public function parseUnitsParameter(array $constraintParameters, $constraintTypeItemId) {
784
+		$items = $this->parseItemsParameter($constraintParameters, $constraintTypeItemId, true);
785 785
 		$unitItems = [];
786 786
 		$unitQuantities = [];
787 787
 		$unitlessAllowed = false;
788 788
 
789
-		foreach ( $items as $item ) {
790
-			$unit = $this->parseUnitItem( $item );
791
-			$unitItems = array_merge( $unitItems, $unit->getUnitItemIds() );
792
-			$unitQuantities = array_merge( $unitQuantities, $unit->getUnitQuantities() );
789
+		foreach ($items as $item) {
790
+			$unit = $this->parseUnitItem($item);
791
+			$unitItems = array_merge($unitItems, $unit->getUnitItemIds());
792
+			$unitQuantities = array_merge($unitQuantities, $unit->getUnitQuantities());
793 793
 			$unitlessAllowed = $unitlessAllowed || $unit->getUnitlessAllowed();
794 794
 		}
795 795
 
796
-		if ( $unitQuantities === [] && !$unitlessAllowed ) {
796
+		if ($unitQuantities === [] && !$unitlessAllowed) {
797 797
 			throw new LogicException(
798 798
 				'The "units" parameter is required, and yet we seem to be missing any allowed unit'
799 799
 			);
800 800
 		}
801 801
 
802
-		return new UnitsParameter( $unitItems, $unitQuantities, $unitlessAllowed );
802
+		return new UnitsParameter($unitItems, $unitQuantities, $unitlessAllowed);
803 803
 	}
804 804
 
805 805
 	/**
@@ -809,33 +809,33 @@  discard block
 block discarded – undo
809 809
 	 * @return EntityTypesParameter
810 810
 	 * @throws ConstraintParameterException
811 811
 	 */
812
-	private function parseEntityTypeItem( ItemIdSnakValue $item ) {
813
-		$entityTypeMapping = $this->config->get( 'WBQualityConstraintsEntityTypeMapping' );
814
-		$parameterId = $this->config->get( 'WBQualityConstraintsQualifierOfPropertyConstraintId' );
812
+	private function parseEntityTypeItem(ItemIdSnakValue $item) {
813
+		$entityTypeMapping = $this->config->get('WBQualityConstraintsEntityTypeMapping');
814
+		$parameterId = $this->config->get('WBQualityConstraintsQualifierOfPropertyConstraintId');
815 815
 
816
-		if ( !$item->isValue() ) {
816
+		if (!$item->isValue()) {
817 817
 			throw new ConstraintParameterException(
818
-				( new ViolationMessage( 'wbqc-violation-message-parameter-value' ) )
819
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
818
+				(new ViolationMessage('wbqc-violation-message-parameter-value'))
819
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
820 820
 			);
821 821
 		}
822 822
 
823 823
 		$itemId = $item->getItemId()->getSerialization();
824
-		if ( !array_key_exists( $itemId, $entityTypeMapping ) ) {
824
+		if (!array_key_exists($itemId, $entityTypeMapping)) {
825 825
 			$entityTypeItemIds = array_map(
826
-				function ( $itemId ) {
827
-					return new ItemId( $itemId );
826
+				function($itemId) {
827
+					return new ItemId($itemId);
828 828
 				},
829
-				array_keys( $entityTypeMapping )
829
+				array_keys($entityTypeMapping)
830 830
 			);
831 831
 			throw new ConstraintParameterException(
832
-				( new ViolationMessage( 'wbqc-violation-message-parameter-oneof' ) )
833
-					->withEntityId( new PropertyId( $parameterId ), Role::CONSTRAINT_PARAMETER_PROPERTY )
834
-					->withEntityIdList( $entityTypeItemIds, Role::CONSTRAINT_PARAMETER_VALUE )
832
+				(new ViolationMessage('wbqc-violation-message-parameter-oneof'))
833
+					->withEntityId(new PropertyId($parameterId), Role::CONSTRAINT_PARAMETER_PROPERTY)
834
+					->withEntityIdList($entityTypeItemIds, Role::CONSTRAINT_PARAMETER_VALUE)
835 835
 			);
836 836
 		}
837 837
 
838
-		return new EntityTypesParameter( [ $entityTypeMapping[$itemId] ], [ $item->getItemId() ] );
838
+		return new EntityTypesParameter([$entityTypeMapping[$itemId]], [$item->getItemId()]);
839 839
 	}
840 840
 
841 841
 	/**
@@ -844,27 +844,27 @@  discard block
 block discarded – undo
844 844
 	 * @throws ConstraintParameterException if the parameter is invalid or missing
845 845
 	 * @return EntityTypesParameter
846 846
 	 */
847
-	public function parseEntityTypesParameter( array $constraintParameters, $constraintTypeItemId ) {
847
+	public function parseEntityTypesParameter(array $constraintParameters, $constraintTypeItemId) {
848 848
 		$entityTypes = [];
849 849
 		$entityTypeItemIds = [];
850
-		$items = $this->parseItemsParameter( $constraintParameters, $constraintTypeItemId, true );
850
+		$items = $this->parseItemsParameter($constraintParameters, $constraintTypeItemId, true);
851 851
 
852
-		foreach ( $items as $item ) {
853
-			$entityType = $this->parseEntityTypeItem( $item );
854
-			$entityTypes = array_merge( $entityTypes, $entityType->getEntityTypes() );
855
-			$entityTypeItemIds = array_merge( $entityTypeItemIds, $entityType->getEntityTypeItemIds() );
852
+		foreach ($items as $item) {
853
+			$entityType = $this->parseEntityTypeItem($item);
854
+			$entityTypes = array_merge($entityTypes, $entityType->getEntityTypes());
855
+			$entityTypeItemIds = array_merge($entityTypeItemIds, $entityType->getEntityTypeItemIds());
856 856
 		}
857 857
 
858
-		if ( empty( $entityTypes ) ) {
858
+		if (empty($entityTypes)) {
859 859
 			// @codeCoverageIgnoreStart
860 860
 			throw new LogicException(
861
-				'The "entity types" parameter is required, ' .
861
+				'The "entity types" parameter is required, '.
862 862
 				'and yet we seem to be missing any allowed entity type'
863 863
 			);
864 864
 			// @codeCoverageIgnoreEnd
865 865
 		}
866 866
 
867
-		return new EntityTypesParameter( $entityTypes, $entityTypeItemIds );
867
+		return new EntityTypesParameter($entityTypes, $entityTypeItemIds);
868 868
 	}
869 869
 
870 870
 }
Please login to merge, or discard this patch.
src/ConstraintCheck/Checker/EntityTypeChecker.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 		];
60 60
 	}
61 61
 
62
-	public function checkConstraint( Context $context, Constraint $constraint ) {
63
-		if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) {
64
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED );
62
+	public function checkConstraint(Context $context, Constraint $constraint) {
63
+		if ($context->getSnakRank() === Statement::RANK_DEPRECATED) {
64
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED);
65 65
 		}
66 66
 
67 67
 		$constraintParameters = $constraint->getConstraintParameters();
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 		);
72 72
 		$parameters['item'] = $entityTypes->getEntityTypes();
73 73
 
74
-		if ( !in_array( $context->getEntity()->getType(), $entityTypes->getEntityTypes() ) ) {
75
-			$message = ( new ViolationMessage( 'wbqc-violation-message-entityType' ) )
76
-				->withEntityId( $context->getSnak()->getPropertyId(), Role::CONSTRAINT_PROPERTY )
77
-				->withEntityIdList( $entityTypes->getEntityTypeItemIds(), Role::CONSTRAINT_PARAMETER_VALUE );
74
+		if (!in_array($context->getEntity()->getType(), $entityTypes->getEntityTypes())) {
75
+			$message = (new ViolationMessage('wbqc-violation-message-entityType'))
76
+				->withEntityId($context->getSnak()->getPropertyId(), Role::CONSTRAINT_PROPERTY)
77
+				->withEntityIdList($entityTypes->getEntityTypeItemIds(), Role::CONSTRAINT_PARAMETER_VALUE);
78 78
 
79 79
 			return new CheckResult(
80 80
 				$context,
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 			);
86 86
 		}
87 87
 
88
-		return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE );
88
+		return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE);
89 89
 	}
90 90
 
91
-	public function checkConstraintParameters( Constraint $constraint ) {
91
+	public function checkConstraintParameters(Constraint $constraint) {
92 92
 		$constraintParameters = $constraint->getConstraintParameters();
93 93
 		$exceptions = [];
94 94
 		try {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 				$constraintParameters,
97 97
 				$constraint->getConstraintTypeItemId()
98 98
 			);
99
-		} catch ( ConstraintParameterException $e ) {
99
+		} catch (ConstraintParameterException $e) {
100 100
 			$exceptions[] = $e;
101 101
 		}
102 102
 		return $exceptions;
Please login to merge, or discard this patch.