Completed
Push — master ( 58f7ad...10c482 )
by
unknown
02:49
created
src/Api/CheckConstraints.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -73,22 +73,22 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @return self
75 75
 	 */
76
-	public static function newFromGlobalState( ApiMain $main, $name, $prefix = '' ) {
76
+	public static function newFromGlobalState(ApiMain $main, $name, $prefix = '') {
77 77
 		$repo = WikibaseRepo::getDefaultInstance();
78 78
 
79 79
 		$language = $repo->getUserLanguage();
80 80
 		$formatterOptions = new FormatterOptions();
81
-		$formatterOptions->setOption( SnakFormatter::OPT_LANG, $language->getCode() );
81
+		$formatterOptions->setOption(SnakFormatter::OPT_LANG, $language->getCode());
82 82
 		$valueFormatterFactory = $repo->getValueFormatterFactory();
83
-		$valueFormatter = $valueFormatterFactory->getValueFormatter( SnakFormatter::FORMAT_HTML, $formatterOptions );
83
+		$valueFormatter = $valueFormatterFactory->getValueFormatter(SnakFormatter::FORMAT_HTML, $formatterOptions);
84 84
 
85 85
 		$languageFallbackLabelDescriptionLookupFactory = $repo->getLanguageFallbackLabelDescriptionLookupFactory();
86
-		$labelDescriptionLookup = $languageFallbackLabelDescriptionLookupFactory->newLabelDescriptionLookup( $language );
86
+		$labelDescriptionLookup = $languageFallbackLabelDescriptionLookupFactory->newLabelDescriptionLookup($language);
87 87
 		$entityIdHtmlLinkFormatterFactory = $repo->getEntityIdHtmlLinkFormatterFactory();
88
-		$entityIdHtmlLinkFormatter = $entityIdHtmlLinkFormatterFactory->getEntityIdFormatter( $labelDescriptionLookup );
88
+		$entityIdHtmlLinkFormatter = $entityIdHtmlLinkFormatterFactory->getEntityIdFormatter($labelDescriptionLookup);
89 89
 		$entityIdLabelFormatterFactory = new EntityIdLabelFormatterFactory();
90
-		$entityIdLabelFormatter = $entityIdLabelFormatterFactory->getEntityIdFormatter( $labelDescriptionLookup );
91
-		$constraintParameterRenderer = new ConstraintParameterRenderer( $entityIdHtmlLinkFormatter, $valueFormatter );
90
+		$entityIdLabelFormatter = $entityIdLabelFormatterFactory->getEntityIdFormatter($labelDescriptionLookup);
91
+		$constraintParameterRenderer = new ConstraintParameterRenderer($entityIdHtmlLinkFormatter, $valueFormatter);
92 92
 		$config = MediaWikiServices::getInstance()->getMainConfig();
93 93
 		$titleParser = MediaWikiServices::getInstance()->getTitleParser();
94 94
 		$unitConverter = $repo->getUnitConverter();
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 			$constraintParameterRenderer,
119 119
 			$config
120 120
 		);
121
-		if ( $config->get( 'WBQualityConstraintsCacheCheckConstraintsResults' ) ) {
121
+		if ($config->get('WBQualityConstraintsCacheCheckConstraintsResults')) {
122 122
 			$wikiPageEntityMetaDataAccessor = new WikiPageEntityMetaDataLookup(
123 123
 				$repo->getEntityNamespaceLookup()
124 124
 			);
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 				ResultsCache::getDefaultInstance(),
130 130
 				$wikiPageEntityMetaDataAccessor,
131 131
 				$entityIdParser,
132
-				$config->get( 'WBQualityConstraintsCacheCheckConstraintsTTLSeconds' ),
132
+				$config->get('WBQualityConstraintsCacheCheckConstraintsTTLSeconds'),
133 133
 				[
134
-					$config->get( 'WBQualityConstraintsCommonsLinkConstraintId' ),
135
-					$config->get( 'WBQualityConstraintsTypeConstraintId' ),
136
-					$config->get( 'WBQualityConstraintsValueTypeConstraintId' ),
137
-					$config->get( 'WBQualityConstraintsDistinctValuesConstraintId' ),
134
+					$config->get('WBQualityConstraintsCommonsLinkConstraintId'),
135
+					$config->get('WBQualityConstraintsTypeConstraintId'),
136
+					$config->get('WBQualityConstraintsValueTypeConstraintId'),
137
+					$config->get('WBQualityConstraintsDistinctValuesConstraintId'),
138 138
 				],
139 139
 				$dataFactory
140 140
 			);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 			$prefix,
147 147
 			$repo->getEntityIdParser(),
148 148
 			$repo->getStatementGuidValidator(),
149
-			$repo->getApiHelperFactory( RequestContext::getMain() ),
149
+			$repo->getApiHelperFactory(RequestContext::getMain()),
150 150
 			$resultsBuilder,
151 151
 			$dataFactory
152 152
 		);
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
 		ResultsBuilder $resultsBuilder,
173 173
 		IBufferingStatsdDataFactory $dataFactory
174 174
 	) {
175
-		parent::__construct( $main, $name, $prefix );
175
+		parent::__construct($main, $name, $prefix);
176 176
 		$this->entityIdParser = $entityIdParser;
177 177
 		$this->statementGuidValidator = $statementGuidValidator;
178
-		$this->resultBuilder = $apiHelperFactory->getResultBuilder( $this );
179
-		$this->errorReporter = $apiHelperFactory->getErrorReporter( $this );
178
+		$this->resultBuilder = $apiHelperFactory->getResultBuilder($this);
179
+		$this->errorReporter = $apiHelperFactory->getErrorReporter($this);
180 180
 		$this->resultsBuilder = $resultsBuilder;
181 181
 		$this->dataFactory = $dataFactory;
182 182
 	}
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
 
192 192
 		$params = $this->extractRequestParams();
193 193
 
194
-		$this->validateParameters( $params );
195
-		$entityIds = $this->parseEntityIds( $params );
196
-		$claimIds = $this->parseClaimIds( $params );
194
+		$this->validateParameters($params);
195
+		$entityIds = $this->parseEntityIds($params);
196
+		$claimIds = $this->parseClaimIds($params);
197 197
 		$constraintIDs = $params[self::PARAM_CONSTRAINT_ID];
198 198
 
199 199
 		$this->getResult()->addValue(
@@ -205,64 +205,64 @@  discard block
 block discarded – undo
205 205
 			)->getArray()
206 206
 		);
207 207
 		// ensure that result contains the given entity IDs even if they have no statements
208
-		foreach ( $entityIds as $entityId ) {
208
+		foreach ($entityIds as $entityId) {
209 209
 			$this->getResult()->addArrayType(
210
-				[ $this->getModuleName(), $entityId->getSerialization() ],
210
+				[$this->getModuleName(), $entityId->getSerialization()],
211 211
 				'assoc'
212 212
 			);
213 213
 		}
214
-		$this->resultBuilder->markSuccess( 1 );
214
+		$this->resultBuilder->markSuccess(1);
215 215
 	}
216 216
 
217
-	private function parseEntityIds( array $params ) {
217
+	private function parseEntityIds(array $params) {
218 218
 		$ids = $params[self::PARAM_ID];
219 219
 
220
-		if ( $ids === null ) {
220
+		if ($ids === null) {
221 221
 			return [];
222
-		} elseif ( $ids === [] ) {
222
+		} elseif ($ids === []) {
223 223
 			$this->errorReporter->dieError(
224
-				'If ' . self::PARAM_ID . ' is specified, it must be nonempty.', 'no-data' );
224
+				'If '.self::PARAM_ID.' is specified, it must be nonempty.', 'no-data' );
225 225
 		}
226 226
 
227
-		return array_map( function ( $id ) {
227
+		return array_map(function($id) {
228 228
 			try {
229
-				return $this->entityIdParser->parse( $id );
230
-			} catch ( EntityIdParsingException $e ) {
229
+				return $this->entityIdParser->parse($id);
230
+			} catch (EntityIdParsingException $e) {
231 231
 				$this->errorReporter->dieError(
232
-					"Invalid id: $id", 'invalid-entity-id', 0, [ self::PARAM_ID => $id ] );
232
+					"Invalid id: $id", 'invalid-entity-id', 0, [self::PARAM_ID => $id] );
233 233
 			}
234
-		}, $ids );
234
+		}, $ids);
235 235
 	}
236 236
 
237
-	private function parseClaimIds( array $params ) {
237
+	private function parseClaimIds(array $params) {
238 238
 		$ids = $params[self::PARAM_CLAIM_ID];
239 239
 
240
-		if ( $ids === null ) {
240
+		if ($ids === null) {
241 241
 			return [];
242
-		} elseif ( $ids === [] ) {
242
+		} elseif ($ids === []) {
243 243
 			$this->errorReporter->dieError(
244
-				'If ' . self::PARAM_CLAIM_ID . ' is specified, it must be nonempty.', 'no-data' );
244
+				'If '.self::PARAM_CLAIM_ID.' is specified, it must be nonempty.', 'no-data' );
245 245
 		}
246 246
 
247
-		foreach ( $ids as $id ) {
248
-			if ( !$this->statementGuidValidator->validate( $id ) ) {
247
+		foreach ($ids as $id) {
248
+			if (!$this->statementGuidValidator->validate($id)) {
249 249
 				$this->errorReporter->dieError(
250
-					"Invalid claim id: $id", 'invalid-guid', 0, [ self::PARAM_CLAIM_ID => $id ] );
250
+					"Invalid claim id: $id", 'invalid-guid', 0, [self::PARAM_CLAIM_ID => $id] );
251 251
 			}
252 252
 		}
253 253
 
254 254
 		return $ids;
255 255
 	}
256 256
 
257
-	private function validateParameters( array $params ) {
258
-		if ( $params[self::PARAM_CONSTRAINT_ID] !== null
259
-			 && empty( $params[self::PARAM_CONSTRAINT_ID] )
257
+	private function validateParameters(array $params) {
258
+		if ($params[self::PARAM_CONSTRAINT_ID] !== null
259
+			 && empty($params[self::PARAM_CONSTRAINT_ID])
260 260
 		) {
261 261
 			$paramConstraintId = self::PARAM_CONSTRAINT_ID;
262 262
 			$this->errorReporter->dieError(
263 263
 				"If $paramConstraintId is specified, it must be nonempty.", 'no-data' );
264 264
 		}
265
-		if ( $params[self::PARAM_ID] === null && $params[self::PARAM_CLAIM_ID] === null ) {
265
+		if ($params[self::PARAM_ID] === null && $params[self::PARAM_CLAIM_ID] === null) {
266 266
 			$paramId = self::PARAM_ID;
267 267
 			$paramClaimId = self::PARAM_CLAIM_ID;
268 268
 			$this->errorReporter->dieError(
Please login to merge, or discard this patch.
src/Api/CachingResultsBuilder.php 1 patch
Spacing   +45 added lines, -46 removed lines patch added patch discarded remove patch
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 	) {
117 117
 		$results = [];
118 118
 		$metadatas = [];
119
-		if ( $this->canUseStoredResults( $entityIds, $claimIds, $constraintIds ) ) {
119
+		if ($this->canUseStoredResults($entityIds, $claimIds, $constraintIds)) {
120 120
 			$storedEntityIds = [];
121
-			foreach ( $entityIds as $entityId ) {
122
-				$storedResults = $this->getStoredResults( $entityId );
123
-				if ( $storedResults !== null ) {
121
+			foreach ($entityIds as $entityId) {
122
+				$storedResults = $this->getStoredResults($entityId);
123
+				if ($storedResults !== null) {
124 124
 					$this->dataFactory->increment(
125 125
 						'wikibase.quality.constraints.cache.entity.hit'
126 126
 					);
@@ -129,20 +129,20 @@  discard block
 block discarded – undo
129 129
 					$storedEntityIds[] = $entityId;
130 130
 				}
131 131
 			}
132
-			$entityIds = array_values( array_diff( $entityIds, $storedEntityIds ) );
132
+			$entityIds = array_values(array_diff($entityIds, $storedEntityIds));
133 133
 		}
134
-		if ( $entityIds !== [] || $claimIds !== [] ) {
134
+		if ($entityIds !== [] || $claimIds !== []) {
135 135
 			$this->dataFactory->updateCount(
136 136
 				'wikibase.quality.constraints.cache.entity.miss',
137
-				count( $entityIds )
137
+				count($entityIds)
138 138
 			);
139
-			$response = $this->getAndStoreResults( $entityIds, $claimIds, $constraintIds );
139
+			$response = $this->getAndStoreResults($entityIds, $claimIds, $constraintIds);
140 140
 			$results += $response->getArray();
141 141
 			$metadatas[] = $response->getMetadata();
142 142
 		}
143 143
 		return new CachedCheckConstraintsResponse(
144 144
 			$results,
145
-			Metadata::merge( $metadatas )
145
+			Metadata::merge($metadatas)
146 146
 		);
147 147
 	}
148 148
 
@@ -175,17 +175,17 @@  discard block
 block discarded – undo
175 175
 		array $claimIds,
176 176
 		array $constraintIds = null
177 177
 	) {
178
-		$results = $this->resultsBuilder->getResults( $entityIds, $claimIds, $constraintIds );
178
+		$results = $this->resultsBuilder->getResults($entityIds, $claimIds, $constraintIds);
179 179
 
180
-		if ( $this->canStoreResults( $entityIds, $claimIds, $constraintIds ) ) {
181
-			foreach ( $entityIds as $entityId ) {
180
+		if ($this->canStoreResults($entityIds, $claimIds, $constraintIds)) {
181
+			foreach ($entityIds as $entityId) {
182 182
 				$value = [
183 183
 					'results' => $results->getArray()[$entityId->getSerialization()],
184 184
 					'latestRevisionIds' => $this->getLatestRevisionIds(
185 185
 						$results->getMetadata()->getDependencyMetadata()->getEntityIds()
186 186
 					),
187 187
 				];
188
-				$this->cache->set( $entityId, $value, $this->ttlInSeconds );
188
+				$this->cache->set($entityId, $value, $this->ttlInSeconds);
189 189
 			}
190 190
 		}
191 191
 
@@ -218,45 +218,44 @@  discard block
 block discarded – undo
218 218
 	public function getStoredResults(
219 219
 		EntityId $entityId
220 220
 	) {
221
-		$value = $this->cache->get( $entityId, $curTTL, [], $asOf );
222
-		$now = call_user_func( $this->microtime, true );
221
+		$value = $this->cache->get($entityId, $curTTL, [], $asOf);
222
+		$now = call_user_func($this->microtime, true);
223 223
 
224
-		if ( $value === false ) {
224
+		if ($value === false) {
225 225
 			return null;
226 226
 		}
227 227
 
228
-		$ageInSeconds = (int)ceil( $now - $asOf );
228
+		$ageInSeconds = (int) ceil($now - $asOf);
229 229
 
230 230
 		$dependedEntityIds = array_map(
231
-			[ $this->entityIdParser, "parse" ],
232
-			array_keys( $value['latestRevisionIds'] )
231
+			[$this->entityIdParser, "parse"],
232
+			array_keys($value['latestRevisionIds'])
233 233
 		);
234 234
 
235
-		if ( $value['latestRevisionIds'] !== $this->getLatestRevisionIds( $dependedEntityIds ) ) {
235
+		if ($value['latestRevisionIds'] !== $this->getLatestRevisionIds($dependedEntityIds)) {
236 236
 			return null;
237 237
 		}
238 238
 
239 239
 		$cachingMetadata = $ageInSeconds > 0 ?
240
-			CachingMetadata::ofMaximumAgeInSeconds( $ageInSeconds ) :
241
-			CachingMetadata::fresh();
240
+			CachingMetadata::ofMaximumAgeInSeconds($ageInSeconds) : CachingMetadata::fresh();
242 241
 
243
-		if ( is_array( $value['results'] ) ) {
244
-			array_walk( $value['results'], [ $this, 'updateCachingMetadata' ], $cachingMetadata );
242
+		if (is_array($value['results'])) {
243
+			array_walk($value['results'], [$this, 'updateCachingMetadata'], $cachingMetadata);
245 244
 		}
246 245
 
247 246
 		return new CachedCheckConstraintsResponse(
248
-			[ $entityId->getSerialization() => $value['results'] ],
247
+			[$entityId->getSerialization() => $value['results']],
249 248
 			array_reduce(
250 249
 				$dependedEntityIds,
251
-				function( Metadata $metadata, EntityId $entityId ) {
252
-					return Metadata::merge( [
250
+				function(Metadata $metadata, EntityId $entityId) {
251
+					return Metadata::merge([
253 252
 						$metadata,
254 253
 						Metadata::ofDependencyMetadata(
255
-							DependencyMetadata::ofEntityId( $entityId )
254
+							DependencyMetadata::ofEntityId($entityId)
256 255
 						)
257
-					] );
256
+					]);
258 257
 				},
259
-				Metadata::ofCachingMetadata( $cachingMetadata )
258
+				Metadata::ofCachingMetadata($cachingMetadata)
260 259
 			)
261 260
 		);
262 261
 	}
@@ -265,39 +264,39 @@  discard block
 block discarded – undo
265 264
 	 * @param EntityId[] $entityIds
266 265
 	 * @return int[]
267 266
 	 */
268
-	private function getLatestRevisionIds( array $entityIds ) {
267
+	private function getLatestRevisionIds(array $entityIds) {
269 268
 		$revisionInformations = $this->wikiPageEntityMetaDataAccessor->loadRevisionInformation(
270 269
 			$entityIds,
271 270
 			EntityRevisionLookup::LATEST_FROM_REPLICA
272 271
 		);
273 272
 		$latestRevisionIds = [];
274
-		foreach ( $revisionInformations as $serialization => $revisionInformation ) {
273
+		foreach ($revisionInformations as $serialization => $revisionInformation) {
275 274
 			$latestRevisionIds[$serialization] = $revisionInformation->page_latest;
276 275
 		}
277 276
 		return $latestRevisionIds;
278 277
 	}
279 278
 
280
-	public function updateCachingMetadata( &$element, $key, CachingMetadata $cachingMetadata ) {
281
-		if ( $key === 'cached' ) {
282
-			$element = CachingMetadata::merge( [
279
+	public function updateCachingMetadata(&$element, $key, CachingMetadata $cachingMetadata) {
280
+		if ($key === 'cached') {
281
+			$element = CachingMetadata::merge([
283 282
 				$cachingMetadata,
284
-				CachingMetadata::ofArray( $element ),
285
-			] )->toArray();
283
+				CachingMetadata::ofArray($element),
284
+			])->toArray();
286 285
 		}
287 286
 		if (
288
-			is_array( $element ) &&
289
-			array_key_exists( 'constraint', $element ) &&
290
-			in_array( $element['constraint']['type'], $this->possiblyStaleConstraintTypes, true )
287
+			is_array($element) &&
288
+			array_key_exists('constraint', $element) &&
289
+			in_array($element['constraint']['type'], $this->possiblyStaleConstraintTypes, true)
291 290
 		) {
292
-			$element['cached'] = CachingMetadata::merge( [
291
+			$element['cached'] = CachingMetadata::merge([
293 292
 				$cachingMetadata,
294 293
 				CachingMetadata::ofArray(
295
-					array_key_exists( 'cached', $element ) ? $element['cached'] : null
294
+					array_key_exists('cached', $element) ? $element['cached'] : null
296 295
 				),
297
-			] )->toArray();
296
+			])->toArray();
298 297
 		}
299
-		if ( is_array( $element ) ) {
300
-			array_walk( $element, [ $this, __FUNCTION__ ], $cachingMetadata );
298
+		if (is_array($element)) {
299
+			array_walk($element, [$this, __FUNCTION__], $cachingMetadata);
301 300
 		}
302 301
 	}
303 302
 
@@ -306,7 +305,7 @@  discard block
 block discarded – undo
306 305
 	 *
307 306
 	 * @param callable $microtime
308 307
 	 */
309
-	public function setMicrotimeFunction( callable $microtime ) {
308
+	public function setMicrotimeFunction(callable $microtime) {
310 309
 		$this->microtime = $microtime;
311 310
 	}
312 311
 
Please login to merge, or discard this patch.
src/Api/CheckingResultsBuilder.php 1 patch
Spacing   +23 added lines, -24 removed lines patch added patch discarded remove patch
@@ -73,44 +73,43 @@  discard block
 block discarded – undo
73 73
 	) {
74 74
 		$response = [];
75 75
 		$metadatas = [];
76
-		foreach ( $entityIds as $entityId ) {
76
+		foreach ($entityIds as $entityId) {
77 77
 			$results = $this->delegatingConstraintChecker->checkAgainstConstraintsOnEntityId(
78 78
 				$entityId,
79 79
 				$constraintIds,
80
-				[ $this, 'defaultResults' ]
80
+				[$this, 'defaultResults']
81 81
 			);
82
-			foreach ( $results as $result ) {
82
+			foreach ($results as $result) {
83 83
 				$metadatas[] = $result->getMetadata();
84
-				$resultArray = $this->checkResultToArray( $result );
85
-				$result->getContext()->storeCheckResultInArray( $resultArray, $response );
84
+				$resultArray = $this->checkResultToArray($result);
85
+				$result->getContext()->storeCheckResultInArray($resultArray, $response);
86 86
 			}
87 87
 		}
88
-		foreach ( $claimIds as $claimId ) {
88
+		foreach ($claimIds as $claimId) {
89 89
 			$results = $this->delegatingConstraintChecker->checkAgainstConstraintsOnClaimId(
90 90
 				$claimId,
91 91
 				$constraintIds,
92
-				[ $this, 'defaultResults' ]
92
+				[$this, 'defaultResults']
93 93
 			);
94
-			foreach ( $results as $result ) {
94
+			foreach ($results as $result) {
95 95
 				$metadatas[] = $result->getMetadata();
96
-				$resultArray = $this->checkResultToArray( $result );
97
-				$result->getContext()->storeCheckResultInArray( $resultArray, $response );
96
+				$resultArray = $this->checkResultToArray($result);
97
+				$result->getContext()->storeCheckResultInArray($resultArray, $response);
98 98
 			}
99 99
 		}
100 100
 		return new CachedCheckConstraintsResponse(
101 101
 			$response,
102
-			Metadata::merge( $metadatas )
102
+			Metadata::merge($metadatas)
103 103
 		);
104 104
 	}
105 105
 
106
-	public function defaultResults( Context $context ) {
106
+	public function defaultResults(Context $context) {
107 107
 		return $context->getType() === Context::TYPE_STATEMENT ?
108
-			[ new NullResult( $context ) ] :
109
-			[];
108
+			[new NullResult($context)] : [];
110 109
 	}
111 110
 
112
-	public function checkResultToArray( CheckResult $checkResult ) {
113
-		if ( $checkResult instanceof NullResult ) {
111
+	public function checkResultToArray(CheckResult $checkResult) {
112
+		if ($checkResult instanceof NullResult) {
114 113
 			return null;
115 114
 		}
116 115
 
@@ -118,10 +117,10 @@  discard block
 block discarded – undo
118 117
 		$typeItemId = $checkResult->getConstraint()->getConstraintTypeItemId();
119 118
 		$constraintPropertyId = $checkResult->getContext()->getSnak()->getPropertyId();
120 119
 
121
-		$title = $this->entityTitleLookup->getTitleForId( $constraintPropertyId );
122
-		$typeLabel = $this->entityIdLabelFormatter->formatEntityId( new ItemId( $typeItemId ) );
120
+		$title = $this->entityTitleLookup->getTitleForId($constraintPropertyId);
121
+		$typeLabel = $this->entityIdLabelFormatter->formatEntityId(new ItemId($typeItemId));
123 122
 		// TODO link to the statement when possible (T169224)
124
-		$link = $title->getFullURL() . '#' . $this->config->get( 'WBQualityConstraintsPropertyConstraintId' );
123
+		$link = $title->getFullURL().'#'.$this->config->get('WBQualityConstraintsPropertyConstraintId');
125 124
 
126 125
 		$constraint = [
127 126
 			'id' => $constraintId,
@@ -130,11 +129,11 @@  discard block
 block discarded – undo
130 129
 			'link' => $link,
131 130
 			'discussLink' => $title->getTalkPage()->getFullURL(),
132 131
 		];
133
-		if ( $this->config->get( 'WBQualityConstraintsIncludeDetailInApi' ) ) {
132
+		if ($this->config->get('WBQualityConstraintsIncludeDetailInApi')) {
134 133
 			$parameters = $checkResult->getParameters();
135 134
 			$constraint += [
136 135
 				'detail' => $parameters,
137
-				'detailHTML' => $this->constraintParameterRenderer->formatParameters( $parameters ),
136
+				'detailHTML' => $this->constraintParameterRenderer->formatParameters($parameters),
138 137
 			];
139 138
 		}
140 139
 
@@ -144,14 +143,14 @@  discard block
 block discarded – undo
144 143
 			'constraint' => $constraint
145 144
 		];
146 145
 		$message = $checkResult->getMessage();
147
-		if ( $message ) {
146
+		if ($message) {
148 147
 			$result['message-html'] = $message;
149 148
 		}
150
-		if ( $checkResult->getContext()->getType() === Context::TYPE_STATEMENT ) {
149
+		if ($checkResult->getContext()->getType() === Context::TYPE_STATEMENT) {
151 150
 			$result['claim'] = $checkResult->getContext()->getSnakStatement()->getGuid();
152 151
 		}
153 152
 		$cachingMetadataArray = $checkResult->getMetadata()->getCachingMetadata()->toArray();
154
-		if ( $cachingMetadataArray !== null ) {
153
+		if ($cachingMetadataArray !== null) {
155 154
 			$result['cached'] = $cachingMetadataArray;
156 155
 		}
157 156
 
Please login to merge, or discard this patch.
src/ConstraintCheck/Context/Context.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,6 +86,6 @@
 block discarded – undo
86 86
 	 * @param array|null $result
87 87
 	 * @param array[] &$container
88 88
 	 */
89
-	public function storeCheckResultInArray( array $result = null, array &$container );
89
+	public function storeCheckResultInArray(array $result = null, array &$container);
90 90
 
91 91
 }
Please login to merge, or discard this patch.
src/ConstraintCheck/Context/ApiV2Context.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,29 +36,29 @@  discard block
 block discarded – undo
36 36
 		$propertyId,
37 37
 		$statementGuid
38 38
 	) {
39
-		if ( !array_key_exists( $entityId, $container ) ) {
39
+		if (!array_key_exists($entityId, $container)) {
40 40
 			$container[$entityId] = [];
41 41
 		}
42 42
 		$entityContainer = &$container[$entityId];
43 43
 
44
-		if ( !array_key_exists( 'claims', $entityContainer ) ) {
44
+		if (!array_key_exists('claims', $entityContainer)) {
45 45
 			$entityContainer['claims'] = [];
46 46
 		}
47 47
 		$claimsContainer = &$entityContainer['claims'];
48 48
 
49
-		if ( !array_key_exists( $propertyId, $claimsContainer ) ) {
49
+		if (!array_key_exists($propertyId, $claimsContainer)) {
50 50
 			$claimsContainer[$propertyId] = [];
51 51
 		}
52 52
 		$propertyContainer = &$claimsContainer[$propertyId];
53 53
 
54
-		foreach ( $propertyContainer as &$statement ) {
55
-			if ( $statement['id'] === $statementGuid ) {
54
+		foreach ($propertyContainer as &$statement) {
55
+			if ($statement['id'] === $statementGuid) {
56 56
 				$statementArray = &$statement;
57 57
 				break;
58 58
 			}
59 59
 		}
60
-		if ( !isset( $statementArray ) ) {
61
-			$statementArray = [ 'id' => $statementGuid ];
60
+		if (!isset($statementArray)) {
61
+			$statementArray = ['id' => $statementGuid];
62 62
 			$propertyContainer[] = &$statementArray;
63 63
 		}
64 64
 
@@ -73,19 +73,19 @@  discard block
 block discarded – undo
73 73
 	 * @param array[] &$container
74 74
 	 * @return array
75 75
 	 */
76
-	abstract protected function &getMainArray( array &$container );
76
+	abstract protected function &getMainArray(array &$container);
77 77
 
78 78
 	/**
79 79
 	 * @param array|null $result
80 80
 	 * @param array[] &$container
81 81
 	 */
82
-	public function storeCheckResultInArray( array $result = null, array &$container ) {
83
-		$mainArray = &$this->getMainArray( $container );
84
-		if ( !array_key_exists( 'results', $mainArray ) ) {
82
+	public function storeCheckResultInArray(array $result = null, array &$container) {
83
+		$mainArray = &$this->getMainArray($container);
84
+		if (!array_key_exists('results', $mainArray)) {
85 85
 			$mainArray['results'] = [];
86 86
 		}
87 87
 
88
-		if ( $result !== null ) {
88
+		if ($result !== null) {
89 89
 			$mainArray['results'][] = $result;
90 90
 		}
91 91
 	}
Please login to merge, or discard this patch.
src/ConstraintCheck/Cache/CachingMetadata.php 1 patch
Spacing   +11 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 	 * @param int $maxAge The maximum age of the cached value (in seconds).
30 30
 	 * @return self Indication that a value is possibly outdated by up to this many seconds.
31 31
 	 */
32
-	public static function ofMaximumAgeInSeconds( $maxAge ) {
33
-		Assert::parameterType( 'integer', $maxAge, '$maxAge' );
34
-		Assert::parameter( $maxAge > 0, '$maxAge', '$maxage > 0' );
32
+	public static function ofMaximumAgeInSeconds($maxAge) {
33
+		Assert::parameterType('integer', $maxAge, '$maxAge');
34
+		Assert::parameter($maxAge > 0, '$maxAge', '$maxage > 0');
35 35
 		$ret = new self;
36 36
 		$ret->maxAge = $maxAge;
37 37
 		return $ret;
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 * @param array|null $array As returned by toArray.
43 43
 	 * @return self
44 44
 	 */
45
-	public static function ofArray( array $array = null ) {
45
+	public static function ofArray(array $array = null) {
46 46
 		$ret = new self;
47
-		if ( $array !== null ) {
47
+		if ($array !== null) {
48 48
 			$ret->maxAge = $array['maximumAgeInSeconds'];
49 49
 		}
50 50
 		return $ret;
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 	 * @param self[] $metadatas
55 55
 	 * @return self
56 56
 	 */
57
-	public static function merge( array $metadatas ) {
58
-		Assert::parameterElementType( self::class, $metadatas, '$metadatas' );
57
+	public static function merge(array $metadatas) {
58
+		Assert::parameterElementType(self::class, $metadatas, '$metadatas');
59 59
 		$ret = new self;
60
-		foreach ( $metadatas as $metadata ) {
61
-			$ret->maxAge = max( $ret->maxAge, $metadata->maxAge );
60
+		foreach ($metadatas as $metadata) {
61
+			$ret->maxAge = max($ret->maxAge, $metadata->maxAge);
62 62
 		}
63 63
 		return $ret;
64 64
 	}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * For a fresh value, returns 0.
77 77
 	 */
78 78
 	public function getMaximumAgeInSeconds() {
79
-		if ( is_int( $this->maxAge ) ) {
79
+		if (is_int($this->maxAge)) {
80 80
 			return $this->maxAge;
81 81
 		} else {
82 82
 			return 0;
@@ -91,8 +91,7 @@  discard block
 block discarded – undo
91 91
 		return $this->isCached() ?
92 92
 			[
93 93
 				'maximumAgeInSeconds' => $this->maxAge,
94
-			] :
95
-			null;
94
+			] : null;
96 95
 	}
97 96
 
98 97
 }
Please login to merge, or discard this patch.
src/ConstraintCheck/Checker/TypeChecker.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -69,32 +69,32 @@  discard block
 block discarded – undo
69 69
 	 * @throws SparqlHelperException if the checker uses SPARQL and the query times out or some other error occurs
70 70
 	 * @return CheckResult
71 71
 	 */
72
-	public function checkConstraint( Context $context, Constraint $constraint ) {
73
-		if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) {
74
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED );
72
+	public function checkConstraint(Context $context, Constraint $constraint) {
73
+		if ($context->getSnakRank() === Statement::RANK_DEPRECATED) {
74
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED);
75 75
 		}
76
-		if ( $context->getType() === Context::TYPE_REFERENCE ) {
77
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_NOT_MAIN_SNAK );
76
+		if ($context->getType() === Context::TYPE_REFERENCE) {
77
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_NOT_MAIN_SNAK);
78 78
 		}
79 79
 
80 80
 		$parameters = [];
81 81
 		$constraintParameters = $constraint->getConstraintParameters();
82 82
 
83
-		$classes = $this->constraintParameterParser->parseClassParameter( $constraintParameters, $constraint->getConstraintTypeItemId() );
83
+		$classes = $this->constraintParameterParser->parseClassParameter($constraintParameters, $constraint->getConstraintTypeItemId());
84 84
 		$parameters['class'] = array_map(
85
-			function( $id ) {
86
-				return new ItemId( $id );
85
+			function($id) {
86
+				return new ItemId($id);
87 87
 			},
88 88
 			$classes
89 89
 		);
90 90
 
91
-		$relation = $this->constraintParameterParser->parseRelationParameter( $constraintParameters, $constraint->getConstraintTypeItemId() );
92
-		if ( $relation === 'instance' ) {
93
-			$relationId = $this->config->get( 'WBQualityConstraintsInstanceOfId' );
94
-		} elseif ( $relation === 'subclass' ) {
95
-			$relationId = $this->config->get( 'WBQualityConstraintsSubclassOfId' );
91
+		$relation = $this->constraintParameterParser->parseRelationParameter($constraintParameters, $constraint->getConstraintTypeItemId());
92
+		if ($relation === 'instance') {
93
+			$relationId = $this->config->get('WBQualityConstraintsInstanceOfId');
94
+		} elseif ($relation === 'subclass') {
95
+			$relationId = $this->config->get('WBQualityConstraintsSubclassOfId');
96 96
 		}
97
-		$parameters['relation'] = [ $relation ];
97
+		$parameters['relation'] = [$relation];
98 98
 
99 99
 		$result = $this->typeCheckerHelper->hasClassInRelation(
100 100
 			$context->getEntity()->getStatements(),
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 			$classes
103 103
 		);
104 104
 
105
-		if ( $result->getBool() ) {
105
+		if ($result->getBool()) {
106 106
 			$message = '';
107 107
 			$status = CheckResult::STATUS_COMPLIANCE;
108 108
 		} else {
@@ -116,21 +116,21 @@  discard block
 block discarded – undo
116 116
 			$status = CheckResult::STATUS_VIOLATION;
117 117
 		}
118 118
 
119
-		return ( new CheckResult( $context, $constraint, $parameters, $status, $message ) )
120
-			->withMetadata( $result->getMetadata() );
119
+		return (new CheckResult($context, $constraint, $parameters, $status, $message))
120
+			->withMetadata($result->getMetadata());
121 121
 	}
122 122
 
123
-	public function checkConstraintParameters( Constraint $constraint ) {
123
+	public function checkConstraintParameters(Constraint $constraint) {
124 124
 		$constraintParameters = $constraint->getConstraintParameters();
125 125
 		$exceptions = [];
126 126
 		try {
127
-			$this->constraintParameterParser->parseClassParameter( $constraintParameters, $constraint->getConstraintTypeItemId() );
128
-		} catch ( ConstraintParameterException $e ) {
127
+			$this->constraintParameterParser->parseClassParameter($constraintParameters, $constraint->getConstraintTypeItemId());
128
+		} catch (ConstraintParameterException $e) {
129 129
 			$exceptions[] = $e;
130 130
 		}
131 131
 		try {
132
-			$this->constraintParameterParser->parseRelationParameter( $constraintParameters, $constraint->getConstraintTypeItemId() );
133
-		} catch ( ConstraintParameterException $e ) {
132
+			$this->constraintParameterParser->parseRelationParameter($constraintParameters, $constraint->getConstraintTypeItemId());
133
+		} catch (ConstraintParameterException $e) {
134 134
 			$exceptions[] = $e;
135 135
 		}
136 136
 		return $exceptions;
Please login to merge, or discard this patch.
src/ConstraintCheck/Checker/InverseChecker.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -71,25 +71,25 @@  discard block
 block discarded – undo
71 71
 	 * @throws ConstraintParameterException
72 72
 	 * @return CheckResult
73 73
 	 */
74
-	public function checkConstraint( Context $context, Constraint $constraint ) {
75
-		if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) {
76
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED );
74
+	public function checkConstraint(Context $context, Constraint $constraint) {
75
+		if ($context->getSnakRank() === Statement::RANK_DEPRECATED) {
76
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED);
77 77
 		}
78
-		if ( $context->getType() !== Context::TYPE_STATEMENT ) {
79
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_NOT_MAIN_SNAK );
78
+		if ($context->getType() !== Context::TYPE_STATEMENT) {
79
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_NOT_MAIN_SNAK);
80 80
 		}
81 81
 
82 82
 		$parameters = [];
83 83
 		$constraintParameters = $constraint->getConstraintParameters();
84 84
 
85
-		$propertyId = $this->constraintParameterParser->parsePropertyParameter( $constraintParameters, $constraint->getConstraintTypeItemId() );
86
-		$parameters['property'] = [ $propertyId ];
85
+		$propertyId = $this->constraintParameterParser->parsePropertyParameter($constraintParameters, $constraint->getConstraintTypeItemId());
86
+		$parameters['property'] = [$propertyId];
87 87
 
88 88
 		$snak = $context->getSnak();
89 89
 
90
-		if ( !$snak instanceof PropertyValueSnak ) {
90
+		if (!$snak instanceof PropertyValueSnak) {
91 91
 			// nothing to check
92
-			return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE, '' );
92
+			return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE, '');
93 93
 		}
94 94
 
95 95
 		$dataValue = $snak->getDataValue();
@@ -98,22 +98,22 @@  discard block
 block discarded – undo
98 98
 		 * error handling:
99 99
 		 *   type of $dataValue for properties with 'Inverse' constraint has to be 'wikibase-entityid'
100 100
 		 */
101
-		if ( $dataValue->getType() !== 'wikibase-entityid' ) {
102
-			$message = wfMessage( "wbqc-violation-message-value-needed-of-type" )
101
+		if ($dataValue->getType() !== 'wikibase-entityid') {
102
+			$message = wfMessage("wbqc-violation-message-value-needed-of-type")
103 103
 					 ->rawParams(
104
-						 $this->constraintParameterRenderer->formatItemId( $constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM ),
104
+						 $this->constraintParameterRenderer->formatItemId($constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM),
105 105
 						 'wikibase-entityid' // TODO is there a message for this type so we can localize it?
106 106
 					 )
107 107
 					 ->escaped();
108
-			return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message );
108
+			return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message);
109 109
 		}
110 110
 		/** @var EntityIdValue $dataValue */
111 111
 
112 112
 		$targetEntityId = $dataValue->getEntityId();
113
-		$targetEntity = $this->entityLookup->getEntity( $targetEntityId );
114
-		if ( $targetEntity === null ) {
115
-			$message = wfMessage( "wbqc-violation-message-target-entity-must-exist" )->escaped();
116
-			return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message );
113
+		$targetEntity = $this->entityLookup->getEntity($targetEntityId);
114
+		if ($targetEntity === null) {
115
+			$message = wfMessage("wbqc-violation-message-target-entity-must-exist")->escaped();
116
+			return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message);
117 117
 		}
118 118
 
119 119
 		$inverseStatement = $this->connectionCheckerHelper->findStatementWithPropertyAndEntityIdValue(
@@ -121,31 +121,31 @@  discard block
 block discarded – undo
121 121
 			$propertyId,
122 122
 			$context->getEntity()->getId()
123 123
 		);
124
-		if ( $inverseStatement !== null ) {
124
+		if ($inverseStatement !== null) {
125 125
 			$message = '';
126 126
 			$status = CheckResult::STATUS_COMPLIANCE;
127 127
 		} else {
128
-			$message = wfMessage( 'wbqc-violation-message-inverse' )
128
+			$message = wfMessage('wbqc-violation-message-inverse')
129 129
 					 ->rawParams(
130
-						 $this->constraintParameterRenderer->formatEntityId( $targetEntityId, Role::SUBJECT ),
131
-						 $this->constraintParameterRenderer->formatEntityId( $propertyId, Role::PREDICATE ),
132
-						 $this->constraintParameterRenderer->formatEntityId( $context->getEntity()->getId(), Role::OBJECT )
130
+						 $this->constraintParameterRenderer->formatEntityId($targetEntityId, Role::SUBJECT),
131
+						 $this->constraintParameterRenderer->formatEntityId($propertyId, Role::PREDICATE),
132
+						 $this->constraintParameterRenderer->formatEntityId($context->getEntity()->getId(), Role::OBJECT)
133 133
 					 )
134 134
 					 ->escaped();
135 135
 			$status = CheckResult::STATUS_VIOLATION;
136 136
 		}
137 137
 
138
-		return ( new CheckResult( $context, $constraint, $parameters, $status, $message ) )
139
-			->withMetadata( Metadata::ofDependencyMetadata(
140
-				DependencyMetadata::ofEntityId( $targetEntityId ) ) );
138
+		return (new CheckResult($context, $constraint, $parameters, $status, $message))
139
+			->withMetadata(Metadata::ofDependencyMetadata(
140
+				DependencyMetadata::ofEntityId($targetEntityId) ));
141 141
 	}
142 142
 
143
-	public function checkConstraintParameters( Constraint $constraint ) {
143
+	public function checkConstraintParameters(Constraint $constraint) {
144 144
 		$constraintParameters = $constraint->getConstraintParameters();
145 145
 		$exceptions = [];
146 146
 		try {
147
-			$this->constraintParameterParser->parsePropertyParameter( $constraintParameters, $constraint->getConstraintTypeItemId() );
148
-		} catch ( ConstraintParameterException $e ) {
147
+			$this->constraintParameterParser->parsePropertyParameter($constraintParameters, $constraint->getConstraintTypeItemId());
148
+		} catch (ConstraintParameterException $e) {
149 149
 			$exceptions[] = $e;
150 150
 		}
151 151
 		return $exceptions;
Please login to merge, or discard this patch.
src/ConstraintCheck/Checker/RangeChecker.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 	 * @throws ConstraintParameterException
69 69
 	 * @return CheckResult
70 70
 	 */
71
-	public function checkConstraint( Context $context, Constraint $constraint ) {
72
-		if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) {
73
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED );
71
+	public function checkConstraint(Context $context, Constraint $constraint) {
72
+		if ($context->getSnakRank() === Statement::RANK_DEPRECATED) {
73
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED);
74 74
 		}
75 75
 
76 76
 		$parameters = [];
@@ -78,42 +78,42 @@  discard block
 block discarded – undo
78 78
 
79 79
 		$snak = $context->getSnak();
80 80
 
81
-		if ( !$snak instanceof PropertyValueSnak ) {
81
+		if (!$snak instanceof PropertyValueSnak) {
82 82
 			// nothing to check
83
-			return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE, '' );
83
+			return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE, '');
84 84
 		}
85 85
 
86 86
 		$dataValue = $snak->getDataValue();
87 87
 
88
-		list( $min, $max ) = $this->constraintParameterParser->parseRangeParameter(
88
+		list($min, $max) = $this->constraintParameterParser->parseRangeParameter(
89 89
 			$constraintParameters,
90 90
 			$constraint->getConstraintTypeItemId(),
91 91
 			$dataValue->getType()
92 92
 		);
93 93
 		$parameterKey = $dataValue->getType() === 'quantity' ? 'quantity' : 'date';
94
-		if ( $min !== null ) {
95
-			$parameters['minimum_' . $parameterKey] = [ $min ];
94
+		if ($min !== null) {
95
+			$parameters['minimum_'.$parameterKey] = [$min];
96 96
 		}
97
-		if ( $max !== null ) {
98
-			$parameters['maximum_' . $parameterKey] = [ $max ];
97
+		if ($max !== null) {
98
+			$parameters['maximum_'.$parameterKey] = [$max];
99 99
 		}
100 100
 
101
-		if ( $this->rangeCheckerHelper->getComparison( $min, $dataValue ) > 0 ||
102
-			 $this->rangeCheckerHelper->getComparison( $dataValue, $max ) > 0
101
+		if ($this->rangeCheckerHelper->getComparison($min, $dataValue) > 0 ||
102
+			 $this->rangeCheckerHelper->getComparison($dataValue, $max) > 0
103 103
 		) {
104 104
 			// at least one of $min, $max is set at this point, otherwise there could be no violation
105 105
 			$type = $dataValue->getType();
106
-			$openness = $min !== null ? ( $max !== null ? 'closed' : 'rightopen' ) : 'leftopen';
107
-			$message = wfMessage( "wbqc-violation-message-range-$type-$openness" );
106
+			$openness = $min !== null ? ($max !== null ? 'closed' : 'rightopen') : 'leftopen';
107
+			$message = wfMessage("wbqc-violation-message-range-$type-$openness");
108 108
 			$message->rawParams(
109
-				$this->constraintParameterRenderer->formatEntityId( $context->getSnak()->getPropertyId(), Role::PREDICATE ),
110
-				$this->constraintParameterRenderer->formatDataValue( $dataValue, Role::OBJECT )
109
+				$this->constraintParameterRenderer->formatEntityId($context->getSnak()->getPropertyId(), Role::PREDICATE),
110
+				$this->constraintParameterRenderer->formatDataValue($dataValue, Role::OBJECT)
111 111
 			);
112
-			if ( $min !== null ) {
113
-				$message->rawParams( $this->constraintParameterRenderer->formatDataValue( $min, Role::OBJECT ) );
112
+			if ($min !== null) {
113
+				$message->rawParams($this->constraintParameterRenderer->formatDataValue($min, Role::OBJECT));
114 114
 			}
115
-			if ( $max !== null ) {
116
-				$message->rawParams( $this->constraintParameterRenderer->formatDataValue( $max, Role::OBJECT ) );
115
+			if ($max !== null) {
116
+				$message->rawParams($this->constraintParameterRenderer->formatDataValue($max, Role::OBJECT));
117 117
 			}
118 118
 			$message = $message->escaped();
119 119
 			$status = CheckResult::STATUS_VIOLATION;
@@ -122,22 +122,22 @@  discard block
 block discarded – undo
122 122
 			$status = CheckResult::STATUS_COMPLIANCE;
123 123
 		}
124 124
 
125
-		return new CheckResult( $context, $constraint, $parameters, $status, $message );
125
+		return new CheckResult($context, $constraint, $parameters, $status, $message);
126 126
 	}
127 127
 
128
-	public function checkConstraintParameters( Constraint $constraint ) {
128
+	public function checkConstraintParameters(Constraint $constraint) {
129 129
 		$constraintParameters = $constraint->getConstraintParameters();
130 130
 		$exceptions = [];
131 131
 		try {
132 132
 			// we don’t have a data value here, so get the type from the property instead
133 133
 			// (the distinction between data type and data value type is irrelevant for 'quantity' and 'time')
134
-			$type = $this->propertyDataTypeLookup->getDataTypeIdForProperty( $constraint->getPropertyId() );
134
+			$type = $this->propertyDataTypeLookup->getDataTypeIdForProperty($constraint->getPropertyId());
135 135
 			$this->constraintParameterParser->parseRangeParameter(
136 136
 				$constraintParameters,
137 137
 				$constraint->getConstraintTypeItemId(),
138 138
 				$type
139 139
 			);
140
-		} catch ( ConstraintParameterException $e ) {
140
+		} catch (ConstraintParameterException $e) {
141 141
 			$exceptions[] = $e;
142 142
 		}
143 143
 		return $exceptions;
Please login to merge, or discard this patch.