Completed
Push — master ( 11da2f...877b3b )
by
unknown
01:46
created
maintenance/ImportConstraintStatements.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
 use Wikimedia\Rdbms\ILBFactory;
12 12
 
13 13
 // @codeCoverageIgnoreStart
14
-$basePath = getenv( "MW_INSTALL_PATH" ) !== false
15
-	? getenv( "MW_INSTALL_PATH" ) : __DIR__ . "/../../..";
14
+$basePath = getenv("MW_INSTALL_PATH") !== false
15
+	? getenv("MW_INSTALL_PATH") : __DIR__."/../../..";
16 16
 
17
-require_once $basePath . "/maintenance/Maintenance.php";
17
+require_once $basePath."/maintenance/Maintenance.php";
18 18
 // @codeCoverageIgnoreEnd
19 19
 
20 20
 /**
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 
47 47
 	public function __construct() {
48 48
 		parent::__construct();
49
-		$this->newUpdateConstraintsTableJob = function ( $propertyIdSerialization ) {
49
+		$this->newUpdateConstraintsTableJob = function($propertyIdSerialization) {
50 50
 			return UpdateConstraintsTableJob::newFromGlobalState(
51 51
 				Title::newMainPage(),
52
-				[ 'propertyId' => $propertyIdSerialization ]
52
+				['propertyId' => $propertyIdSerialization]
53 53
 			);
54 54
 		};
55 55
 
56
-		$this->addDescription( 'Imports property constraints from statements on properties' );
57
-		$this->requireExtension( 'WikibaseQualityConstraints' );
58
-		$this->setBatchSize( 10 );
56
+		$this->addDescription('Imports property constraints from statements on properties');
57
+		$this->requireExtension('WikibaseQualityConstraints');
58
+		$this->setBatchSize(10);
59 59
 
60 60
 		// Wikibase classes are not yet loaded, so setup services in a callback run in execute
61 61
 		// that can be overridden in tests.
62
-		$this->setupServices = function () {
62
+		$this->setupServices = function() {
63 63
 			$repo = WikibaseRepo::getDefaultInstance();
64 64
 			$this->propertyInfoLookup = $repo->getStore()->getPropertyInfoLookup();
65 65
 			$this->lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
@@ -67,36 +67,36 @@  discard block
 block discarded – undo
67 67
 	}
68 68
 
69 69
 	public function execute() {
70
-		( $this->setupServices )();
71
-		if ( !$this->getConfig()->get( 'WBQualityConstraintsEnableConstraintsImportFromStatements' ) ) {
72
-			$this->error( 'Constraint statements are not enabled. Aborting.' );
70
+		($this->setupServices)();
71
+		if (!$this->getConfig()->get('WBQualityConstraintsEnableConstraintsImportFromStatements')) {
72
+			$this->error('Constraint statements are not enabled. Aborting.');
73 73
 			return;
74 74
 		}
75 75
 
76 76
 		$propertyInfos = $this->propertyInfoLookup->getAllPropertyInfo();
77
-		$propertyIds = array_keys( $propertyInfos );
77
+		$propertyIds = array_keys($propertyInfos);
78 78
 
79
-		foreach ( array_chunk( $propertyIds, $this->getBatchSize() ) as $propertyIdsChunk ) {
80
-			foreach ( $propertyIdsChunk as $propertyIdSerialization ) {
81
-				$this->output( sprintf(
79
+		foreach (array_chunk($propertyIds, $this->getBatchSize()) as $propertyIdsChunk) {
80
+			foreach ($propertyIdsChunk as $propertyIdSerialization) {
81
+				$this->output(sprintf(
82 82
 					'Importing constraint statements for % 6s... ',
83 83
 					$propertyIdSerialization ),
84 84
 					$propertyIdSerialization
85 85
 				);
86
-				$startTime = microtime( true );
87
-				$job = call_user_func( $this->newUpdateConstraintsTableJob, $propertyIdSerialization );
86
+				$startTime = microtime(true);
87
+				$job = call_user_func($this->newUpdateConstraintsTableJob, $propertyIdSerialization);
88 88
 				$job->run();
89
-				$endTime = microtime( true );
90
-				$millis = ( $endTime - $startTime ) * 1000;
91
-				$this->output( sprintf( 'done in % 6.2f ms.', $millis ), $propertyIdSerialization );
89
+				$endTime = microtime(true);
90
+				$millis = ($endTime - $startTime) * 1000;
91
+				$this->output(sprintf('done in % 6.2f ms.', $millis), $propertyIdSerialization);
92 92
 			}
93 93
 
94
-			$this->output( 'Waiting for replication... ', 'waitForReplication' );
95
-			$startTime = microtime( true );
94
+			$this->output('Waiting for replication... ', 'waitForReplication');
95
+			$startTime = microtime(true);
96 96
 			$this->lbFactory->waitForReplication();
97
-			$endTime = microtime( true );
98
-			$millis = ( $endTime - $startTime ) * 1000;
99
-			$this->output( sprintf( 'done in % 6.2f ms.', $millis ), 'waitForReplication' );
97
+			$endTime = microtime(true);
98
+			$millis = ($endTime - $startTime) * 1000;
99
+			$this->output(sprintf('done in % 6.2f ms.', $millis), 'waitForReplication');
100 100
 		}
101 101
 	}
102 102
 
Please login to merge, or discard this patch.
src/Job/UpdateConstraintsTableJob.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	private const BATCH_SIZE = 50;
40 40
 
41
-	public static function newFromGlobalState( Title $title, array $params ) {
42
-		Assert::parameterType( 'string', $params['propertyId'], '$params["propertyId"]' );
41
+	public static function newFromGlobalState(Title $title, array $params) {
42
+		Assert::parameterType('string', $params['propertyId'], '$params["propertyId"]');
43 43
 		$services = MediaWikiServices::getInstance();
44 44
 		$repo = WikibaseRepo::getDefaultInstance();
45 45
 		return new UpdateConstraintsTableJob(
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			$services->getMainConfig(),
51 51
 			ConstraintsServices::getConstraintStore(),
52 52
 			$services->getDBLoadBalancerFactory(),
53
-			$repo->getEntityRevisionLookup( Store::LOOKUP_CACHING_DISABLED ),
53
+			$repo->getEntityRevisionLookup(Store::LOOKUP_CACHING_DISABLED),
54 54
 			$repo->getBaseDataModelSerializerFactory()->newSnakSerializer()
55 55
 		);
56 56
 	}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		EntityRevisionLookup $entityRevisionLookup,
111 111
 		Serializer $snakSerializer
112 112
 	) {
113
-		parent::__construct( 'constraintsTableUpdate', $title, $params );
113
+		parent::__construct('constraintsTableUpdate', $title, $params);
114 114
 
115 115
 		$this->propertyId = $propertyId;
116 116
 		$this->revisionId = $revisionId;
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
 		$this->snakSerializer = $snakSerializer;
122 122
 	}
123 123
 
124
-	public function extractParametersFromQualifiers( SnakList $qualifiers ) {
124
+	public function extractParametersFromQualifiers(SnakList $qualifiers) {
125 125
 		$parameters = [];
126
-		foreach ( $qualifiers as $qualifier ) {
126
+		foreach ($qualifiers as $qualifier) {
127 127
 			$qualifierId = $qualifier->getPropertyId()->getSerialization();
128
-			$paramSerialization = $this->snakSerializer->serialize( $qualifier );
128
+			$paramSerialization = $this->snakSerializer->serialize($qualifier);
129 129
 			$parameters[$qualifierId][] = $paramSerialization;
130 130
 		}
131 131
 		return $parameters;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		'@phan-var \Wikibase\DataModel\Entity\EntityIdValue $dataValue';
143 143
 		$entityId = $dataValue->getEntityId();
144 144
 		$constraintTypeQid = $entityId->getSerialization();
145
-		$parameters = $this->extractParametersFromQualifiers( $constraintStatement->getQualifiers() );
145
+		$parameters = $this->extractParametersFromQualifiers($constraintStatement->getQualifiers());
146 146
 		return new Constraint(
147 147
 			$constraintId,
148 148
 			$propertyId,
@@ -157,24 +157,24 @@  discard block
 block discarded – undo
157 157
 		PropertyId $propertyConstraintPropertyId
158 158
 	) {
159 159
 		$constraintsStatements = $property->getStatements()
160
-			->getByPropertyId( $propertyConstraintPropertyId )
161
-			->getByRank( [ Statement::RANK_PREFERRED, Statement::RANK_NORMAL ] );
160
+			->getByPropertyId($propertyConstraintPropertyId)
161
+			->getByRank([Statement::RANK_PREFERRED, Statement::RANK_NORMAL]);
162 162
 		$constraints = [];
163
-		foreach ( $constraintsStatements->getIterator() as $constraintStatement ) {
164
-			$constraints[] = $this->extractConstraintFromStatement( $property->getId(), $constraintStatement );
165
-			if ( count( $constraints ) >= self::BATCH_SIZE ) {
166
-				$constraintStore->insertBatch( $constraints );
163
+		foreach ($constraintsStatements->getIterator() as $constraintStatement) {
164
+			$constraints[] = $this->extractConstraintFromStatement($property->getId(), $constraintStatement);
165
+			if (count($constraints) >= self::BATCH_SIZE) {
166
+				$constraintStore->insertBatch($constraints);
167 167
 				// interrupt transaction and wait for replication
168
-				$connection = $this->lbFactory->getMainLB()->getConnection( DB_MASTER );
169
-				$connection->endAtomic( __CLASS__ );
170
-				if ( !$connection->explicitTrxActive() ) {
168
+				$connection = $this->lbFactory->getMainLB()->getConnection(DB_MASTER);
169
+				$connection->endAtomic(__CLASS__);
170
+				if (!$connection->explicitTrxActive()) {
171 171
 					$this->lbFactory->waitForReplication();
172 172
 				}
173
-				$connection->startAtomic( __CLASS__ );
173
+				$connection->startAtomic(__CLASS__);
174 174
 				$constraints = [];
175 175
 			}
176 176
 		}
177
-		$constraintStore->insertBatch( $constraints );
177
+		$constraintStore->insertBatch($constraints);
178 178
 	}
179 179
 
180 180
 	/**
@@ -185,24 +185,24 @@  discard block
 block discarded – undo
185 185
 	public function run() {
186 186
 		// TODO in the future: only touch constraints affected by the edit (requires T163465)
187 187
 
188
-		$propertyId = new PropertyId( $this->propertyId );
188
+		$propertyId = new PropertyId($this->propertyId);
189 189
 		$propertyRevision = $this->entityRevisionLookup->getEntityRevision(
190 190
 			$propertyId,
191 191
 			0, // latest
192 192
 			LookupConstants::LATEST_FROM_REPLICA
193 193
 		);
194 194
 
195
-		if ( $this->revisionId !== null && $propertyRevision->getRevisionId() < $this->revisionId ) {
196
-			JobQueueGroup::singleton()->push( $this );
195
+		if ($this->revisionId !== null && $propertyRevision->getRevisionId() < $this->revisionId) {
196
+			JobQueueGroup::singleton()->push($this);
197 197
 			return true;
198 198
 		}
199 199
 
200
-		$connection = $this->lbFactory->getMainLB()->getConnection( DB_MASTER );
200
+		$connection = $this->lbFactory->getMainLB()->getConnection(DB_MASTER);
201 201
 		// start transaction (if not started yet) – using __CLASS__, not __METHOD__,
202 202
 		// because importConstraintsForProperty() can interrupt the transaction
203
-		$connection->startAtomic( __CLASS__ );
203
+		$connection->startAtomic(__CLASS__);
204 204
 
205
-		$this->constraintStore->deleteForProperty( $propertyId );
205
+		$this->constraintStore->deleteForProperty($propertyId);
206 206
 
207 207
 		/** @var Property $property */
208 208
 		$property = $propertyRevision->getEntity();
@@ -210,10 +210,10 @@  discard block
 block discarded – undo
210 210
 		$this->importConstraintsForProperty(
211 211
 			$property,
212 212
 			$this->constraintStore,
213
-			new PropertyId( $this->config->get( 'WBQualityConstraintsPropertyConstraintId' ) )
213
+			new PropertyId($this->config->get('WBQualityConstraintsPropertyConstraintId'))
214 214
 		);
215 215
 
216
-		$connection->endAtomic( __CLASS__ );
216
+		$connection->endAtomic(__CLASS__);
217 217
 
218 218
 		return true;
219 219
 	}
Please login to merge, or discard this patch.
src/Api/ResultsCache.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 * @param WANObjectCache $cache
37 37
 	 * @param string $formatVersion The version of the API response format.
38 38
 	 */
39
-	public function __construct( WANObjectCache $cache, $formatVersion ) {
39
+	public function __construct(WANObjectCache $cache, $formatVersion) {
40 40
 		$this->cache = $cache;
41 41
 		$this->formatVersion = $formatVersion;
42 42
 	}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 * @param EntityId $entityId
46 46
 	 * @return string cache key
47 47
 	 */
48
-	public function makeKey( EntityId $entityId ) {
48
+	public function makeKey(EntityId $entityId) {
49 49
 		return $this->cache->makeKey(
50 50
 			'WikibaseQualityConstraints', // extension
51 51
 			'checkConstraints', // action
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 	 * @param mixed|null &$info
62 62
 	 * @return mixed
63 63
 	 */
64
-	public function get( EntityId $key, &$curTTL = null, array $checkKeys = [], &$info = null ) {
65
-		return $this->cache->get( $this->makeKey( $key ), $curTTL, $checkKeys, $info );
64
+	public function get(EntityId $key, &$curTTL = null, array $checkKeys = [], &$info = null) {
65
+		return $this->cache->get($this->makeKey($key), $curTTL, $checkKeys, $info);
66 66
 	}
67 67
 
68 68
 	/**
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
 	 * @param array $opts
73 73
 	 * @return bool
74 74
 	 */
75
-	public function set( EntityId $key, $value, $ttl = 0, array $opts = [] ) {
76
-		return $this->cache->set( $this->makeKey( $key ), $value, $ttl, $opts );
75
+	public function set(EntityId $key, $value, $ttl = 0, array $opts = []) {
76
+		return $this->cache->set($this->makeKey($key), $value, $ttl, $opts);
77 77
 	}
78 78
 
79 79
 	/**
80 80
 	 * @param EntityId $key
81 81
 	 * @return bool
82 82
 	 */
83
-	public function delete( EntityId $key ) {
84
-		return $this->cache->delete( $this->makeKey( $key ) );
83
+	public function delete(EntityId $key) {
84
+		return $this->cache->delete($this->makeKey($key));
85 85
 	}
86 86
 
87 87
 }
Please login to merge, or discard this patch.
src/ServiceWiring.php 1 patch
Spacing   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -28,46 +28,46 @@  discard block
 block discarded – undo
28 28
 use WikibaseQuality\ConstraintReport\ConstraintCheck\Result\CheckResultSerializer;
29 29
 
30 30
 return [
31
-	ConstraintsServices::EXPIRY_LOCK => function ( MediaWikiServices $services ) {
32
-		return new ExpiryLock( ObjectCache::getInstance( CACHE_ANYTHING ) );
31
+	ConstraintsServices::EXPIRY_LOCK => function(MediaWikiServices $services) {
32
+		return new ExpiryLock(ObjectCache::getInstance(CACHE_ANYTHING));
33 33
 	},
34 34
 
35
-	ConstraintsServices::LOGGING_HELPER => function ( MediaWikiServices $services ) {
35
+	ConstraintsServices::LOGGING_HELPER => function(MediaWikiServices $services) {
36 36
 		return new LoggingHelper(
37 37
 			$services->getStatsdDataFactory(),
38
-			LoggerFactory::getInstance( 'WikibaseQualityConstraints' ),
38
+			LoggerFactory::getInstance('WikibaseQualityConstraints'),
39 39
 			$services->getMainConfig()
40 40
 		);
41 41
 	},
42 42
 
43
-	ConstraintsServices::CONSTRAINT_STORE => function ( MediaWikiServices $services ) {
44
-		$sourceDefinitions = WikibaseRepo::getEntitySourceDefinitions( $services );
45
-		$propertySource = $sourceDefinitions->getSourceForEntityType( Property::ENTITY_TYPE );
43
+	ConstraintsServices::CONSTRAINT_STORE => function(MediaWikiServices $services) {
44
+		$sourceDefinitions = WikibaseRepo::getEntitySourceDefinitions($services);
45
+		$propertySource = $sourceDefinitions->getSourceForEntityType(Property::ENTITY_TYPE);
46 46
 		$dbName = $propertySource->getDatabaseName();
47
-		$localEntitySourceName = WikibaseRepo::getLocalEntitySource( $services )->getSourceName();
47
+		$localEntitySourceName = WikibaseRepo::getLocalEntitySource($services)->getSourceName();
48 48
 
49
-		if ( $propertySource->getSourceName() !== $localEntitySourceName ) {
50
-			throw new \RuntimeException( 'Can\'t get a ConstraintStore for a non local entity source.' );
49
+		if ($propertySource->getSourceName() !== $localEntitySourceName) {
50
+			throw new \RuntimeException('Can\'t get a ConstraintStore for a non local entity source.');
51 51
 		}
52 52
 
53 53
 		return new ConstraintRepositoryStore(
54
-			$services->getDBLoadBalancerFactory()->getMainLB( $dbName ),
54
+			$services->getDBLoadBalancerFactory()->getMainLB($dbName),
55 55
 			$dbName
56 56
 		);
57 57
 	},
58 58
 
59
-	ConstraintsServices::CONSTRAINT_LOOKUP => function ( MediaWikiServices $services ) {
60
-		$sourceDefinitions = WikibaseRepo::getEntitySourceDefinitions( $services );
61
-		$propertySource = $sourceDefinitions->getSourceForEntityType( Property::ENTITY_TYPE );
59
+	ConstraintsServices::CONSTRAINT_LOOKUP => function(MediaWikiServices $services) {
60
+		$sourceDefinitions = WikibaseRepo::getEntitySourceDefinitions($services);
61
+		$propertySource = $sourceDefinitions->getSourceForEntityType(Property::ENTITY_TYPE);
62 62
 		$dbName = $propertySource->getDatabaseName();
63 63
 		$rawLookup = new ConstraintRepositoryLookup(
64
-			$services->getDBLoadBalancerFactory()->getMainLB( $dbName ),
64
+			$services->getDBLoadBalancerFactory()->getMainLB($dbName),
65 65
 			$dbName
66 66
 		);
67
-		return new CachingConstraintLookup( $rawLookup );
67
+		return new CachingConstraintLookup($rawLookup);
68 68
 	},
69 69
 
70
-	ConstraintsServices::CHECK_RESULT_SERIALIZER => function ( MediaWikiServices $services ) {
70
+	ConstraintsServices::CHECK_RESULT_SERIALIZER => function(MediaWikiServices $services) {
71 71
 		return new CheckResultSerializer(
72 72
 			new ConstraintSerializer(
73 73
 				false // constraint parameters are not exposed
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 		);
79 79
 	},
80 80
 
81
-	ConstraintsServices::CHECK_RESULT_DESERIALIZER => function ( MediaWikiServices $services ) {
82
-		$entityIdParser = WikibaseRepo::getEntityIdParser( $services );
83
-		$dataValueFactory = WikibaseRepo::getDataValueFactory( $services );
81
+	ConstraintsServices::CHECK_RESULT_DESERIALIZER => function(MediaWikiServices $services) {
82
+		$entityIdParser = WikibaseRepo::getEntityIdParser($services);
83
+		$dataValueFactory = WikibaseRepo::getDataValueFactory($services);
84 84
 
85 85
 		return new CheckResultDeserializer(
86 86
 			new ConstraintDeserializer(),
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
 		);
94 94
 	},
95 95
 
96
-	ConstraintsServices::VIOLATION_MESSAGE_SERIALIZER => function ( MediaWikiServices $services ) {
96
+	ConstraintsServices::VIOLATION_MESSAGE_SERIALIZER => function(MediaWikiServices $services) {
97 97
 		return new ViolationMessageSerializer();
98 98
 	},
99 99
 
100
-	ConstraintsServices::VIOLATION_MESSAGE_DESERIALIZER => function ( MediaWikiServices $services ) {
101
-		$entityIdParser = WikibaseRepo::getEntityIdParser( $services );
102
-		$dataValueFactory = WikibaseRepo::getDataValueFactory( $services );
100
+	ConstraintsServices::VIOLATION_MESSAGE_DESERIALIZER => function(MediaWikiServices $services) {
101
+		$entityIdParser = WikibaseRepo::getEntityIdParser($services);
102
+		$dataValueFactory = WikibaseRepo::getDataValueFactory($services);
103 103
 
104 104
 		return new ViolationMessageDeserializer(
105 105
 			$entityIdParser,
@@ -107,24 +107,24 @@  discard block
 block discarded – undo
107 107
 		);
108 108
 	},
109 109
 
110
-	ConstraintsServices::CONSTRAINT_PARAMETER_PARSER => function ( MediaWikiServices $services ) {
110
+	ConstraintsServices::CONSTRAINT_PARAMETER_PARSER => function(MediaWikiServices $services) {
111 111
 		// TODO in the future, get DeserializerFactory from $services?
112 112
 		$repo = WikibaseRepo::getDefaultInstance();
113 113
 		$deserializerFactory = $repo->getBaseDataModelDeserializerFactory();
114
-		$entitySourceDefinitions = WikibaseRepo::getEntitySourceDefinitions( $services );
114
+		$entitySourceDefinitions = WikibaseRepo::getEntitySourceDefinitions($services);
115 115
 
116 116
 		return new ConstraintParameterParser(
117 117
 			$services->getMainConfig(),
118 118
 			$deserializerFactory,
119
-			$entitySourceDefinitions->getSourceForEntityType( 'item' )->getConceptBaseUri()
119
+			$entitySourceDefinitions->getSourceForEntityType('item')->getConceptBaseUri()
120 120
 		);
121 121
 	},
122 122
 
123
-	ConstraintsServices::CONNECTION_CHECKER_HELPER => function ( MediaWikiServices $services ) {
123
+	ConstraintsServices::CONNECTION_CHECKER_HELPER => function(MediaWikiServices $services) {
124 124
 		return new ConnectionCheckerHelper();
125 125
 	},
126 126
 
127
-	ConstraintsServices::RANGE_CHECKER_HELPER => function ( MediaWikiServices $services ) {
127
+	ConstraintsServices::RANGE_CHECKER_HELPER => function(MediaWikiServices $services) {
128 128
 		// TODO in the future, get UnitConverter from $services?
129 129
 		$repo = WikibaseRepo::getDefaultInstance();
130 130
 		$unitConverter = $repo->getUnitConverter();
@@ -135,16 +135,16 @@  discard block
 block discarded – undo
135 135
 		);
136 136
 	},
137 137
 
138
-	ConstraintsServices::SPARQL_HELPER => function ( MediaWikiServices $services ) {
139
-		$endpoint = $services->getMainConfig()->get( 'WBQualityConstraintsSparqlEndpoint' );
140
-		if ( $endpoint === '' ) {
138
+	ConstraintsServices::SPARQL_HELPER => function(MediaWikiServices $services) {
139
+		$endpoint = $services->getMainConfig()->get('WBQualityConstraintsSparqlEndpoint');
140
+		if ($endpoint === '') {
141 141
 			return new DummySparqlHelper();
142 142
 		}
143 143
 
144 144
 		// TODO in the future, get RDFVocabulary and PropertyDataTypeLookup from $services?
145 145
 		$repo = WikibaseRepo::getDefaultInstance();
146 146
 		$rdfVocabulary = $repo->getRdfVocabulary();
147
-		$entityIdParser = WikibaseRepo::getEntityIdParser( $services );
147
+		$entityIdParser = WikibaseRepo::getEntityIdParser($services);
148 148
 		$propertyDataTypeLookup = $repo->getPropertyDataTypeLookup();
149 149
 
150 150
 		return new SparqlHelper(
@@ -153,122 +153,122 @@  discard block
 block discarded – undo
153 153
 			$entityIdParser,
154 154
 			$propertyDataTypeLookup,
155 155
 			$services->getMainWANObjectCache(),
156
-			ConstraintsServices::getViolationMessageSerializer( $services ),
157
-			ConstraintsServices::getViolationMessageDeserializer( $services ),
156
+			ConstraintsServices::getViolationMessageSerializer($services),
157
+			ConstraintsServices::getViolationMessageDeserializer($services),
158 158
 			$services->getStatsdDataFactory(),
159
-			ConstraintsServices::getExpiryLock( $services ),
159
+			ConstraintsServices::getExpiryLock($services),
160 160
 			ConstraintsServices::getLoggingHelper(),
161
-			wfWikiID() . ' WikibaseQualityConstraints ' . Http::userAgent(),
161
+			wfWikiID().' WikibaseQualityConstraints '.Http::userAgent(),
162 162
 			$services->getHttpRequestFactory()
163 163
 		);
164 164
 	},
165 165
 
166
-	ConstraintsServices::TYPE_CHECKER_HELPER => function ( MediaWikiServices $services ) {
166
+	ConstraintsServices::TYPE_CHECKER_HELPER => function(MediaWikiServices $services) {
167 167
 		return new TypeCheckerHelper(
168
-			WikibaseServices::getEntityLookup( $services ),
168
+			WikibaseServices::getEntityLookup($services),
169 169
 			$services->getMainConfig(),
170
-			ConstraintsServices::getSparqlHelper( $services ),
170
+			ConstraintsServices::getSparqlHelper($services),
171 171
 			$services->getStatsdDataFactory()
172 172
 		);
173 173
 	},
174 174
 
175
-	ConstraintsServices::DELEGATING_CONSTRAINT_CHECKER => function ( MediaWikiServices $services ) {
176
-		$statementGuidParser = WikibaseRepo::getStatementGuidParser( $services );
175
+	ConstraintsServices::DELEGATING_CONSTRAINT_CHECKER => function(MediaWikiServices $services) {
176
+		$statementGuidParser = WikibaseRepo::getStatementGuidParser($services);
177 177
 
178 178
 		$config = $services->getMainConfig();
179 179
 		$checkerMap = [
180
-			$config->get( 'WBQualityConstraintsConflictsWithConstraintId' )
181
-				=> ConstraintCheckerServices::getConflictsWithChecker( $services ),
182
-			$config->get( 'WBQualityConstraintsItemRequiresClaimConstraintId' )
183
-				=> ConstraintCheckerServices::getItemChecker( $services ),
184
-			$config->get( 'WBQualityConstraintsValueRequiresClaimConstraintId' )
185
-				=> ConstraintCheckerServices::getTargetRequiredClaimChecker( $services ),
186
-			$config->get( 'WBQualityConstraintsSymmetricConstraintId' )
187
-				=> ConstraintCheckerServices::getSymmetricChecker( $services ),
188
-			$config->get( 'WBQualityConstraintsInverseConstraintId' )
189
-				=> ConstraintCheckerServices::getInverseChecker( $services ),
190
-			$config->get( 'WBQualityConstraintsUsedAsQualifierConstraintId' )
191
-				=> ConstraintCheckerServices::getQualifierChecker( $services ),
192
-			$config->get( 'WBQualityConstraintsAllowedQualifiersConstraintId' )
193
-				=> ConstraintCheckerServices::getQualifiersChecker( $services ),
194
-			$config->get( 'WBQualityConstraintsMandatoryQualifierConstraintId' )
195
-				=> ConstraintCheckerServices::getMandatoryQualifiersChecker( $services ),
196
-			$config->get( 'WBQualityConstraintsRangeConstraintId' )
197
-				=> ConstraintCheckerServices::getRangeChecker( $services ),
198
-			$config->get( 'WBQualityConstraintsDifferenceWithinRangeConstraintId' )
199
-				=> ConstraintCheckerServices::getDiffWithinRangeChecker( $services ),
200
-			$config->get( 'WBQualityConstraintsTypeConstraintId' )
201
-				=> ConstraintCheckerServices::getTypeChecker( $services ),
202
-			$config->get( 'WBQualityConstraintsValueTypeConstraintId' )
203
-				=> ConstraintCheckerServices::getValueTypeChecker( $services ),
204
-			$config->get( 'WBQualityConstraintsSingleValueConstraintId' )
205
-				=> ConstraintCheckerServices::getSingleValueChecker( $services ),
206
-			$config->get( 'WBQualityConstraintsMultiValueConstraintId' )
207
-				=> ConstraintCheckerServices::getMultiValueChecker( $services ),
208
-			$config->get( 'WBQualityConstraintsDistinctValuesConstraintId' )
209
-				=> ConstraintCheckerServices::getUniqueValueChecker( $services ),
210
-			$config->get( 'WBQualityConstraintsFormatConstraintId' )
211
-				=> ConstraintCheckerServices::getFormatChecker( $services ),
212
-			$config->get( 'WBQualityConstraintsCommonsLinkConstraintId' )
213
-				=> ConstraintCheckerServices::getCommonsLinkChecker( $services ),
214
-			$config->get( 'WBQualityConstraintsOneOfConstraintId' )
215
-				=> ConstraintCheckerServices::getOneOfChecker( $services ),
216
-			$config->get( 'WBQualityConstraintsUsedForValuesOnlyConstraintId' )
217
-				=> ConstraintCheckerServices::getValueOnlyChecker( $services ),
218
-			$config->get( 'WBQualityConstraintsUsedAsReferenceConstraintId' )
219
-				=> ConstraintCheckerServices::getReferenceChecker( $services ),
220
-			$config->get( 'WBQualityConstraintsNoBoundsConstraintId' )
221
-				=> ConstraintCheckerServices::getNoBoundsChecker( $services ),
222
-			$config->get( 'WBQualityConstraintsAllowedUnitsConstraintId' )
223
-				=> ConstraintCheckerServices::getAllowedUnitsChecker( $services ),
224
-			$config->get( 'WBQualityConstraintsSingleBestValueConstraintId' )
225
-				=> ConstraintCheckerServices::getSingleBestValueChecker( $services ),
226
-			$config->get( 'WBQualityConstraintsAllowedEntityTypesConstraintId' )
227
-				=> ConstraintCheckerServices::getEntityTypeChecker( $services ),
228
-			$config->get( 'WBQualityConstraintsNoneOfConstraintId' )
229
-				=> ConstraintCheckerServices::getNoneOfChecker( $services ),
230
-			$config->get( 'WBQualityConstraintsIntegerConstraintId' )
231
-				=> ConstraintCheckerServices::getIntegerChecker( $services ),
232
-			$config->get( 'WBQualityConstraintsCitationNeededConstraintId' )
233
-				=> ConstraintCheckerServices::getCitationNeededChecker( $services ),
234
-			$config->get( 'WBQualityConstraintsPropertyScopeConstraintId' )
235
-				=> ConstraintCheckerServices::getPropertyScopeChecker( $services ),
236
-			$config->get( 'WBQualityConstraintsContemporaryConstraintId' )
237
-				=> ConstraintCheckerServices::getContemporaryChecker( $services ),
180
+			$config->get('WBQualityConstraintsConflictsWithConstraintId')
181
+				=> ConstraintCheckerServices::getConflictsWithChecker($services),
182
+			$config->get('WBQualityConstraintsItemRequiresClaimConstraintId')
183
+				=> ConstraintCheckerServices::getItemChecker($services),
184
+			$config->get('WBQualityConstraintsValueRequiresClaimConstraintId')
185
+				=> ConstraintCheckerServices::getTargetRequiredClaimChecker($services),
186
+			$config->get('WBQualityConstraintsSymmetricConstraintId')
187
+				=> ConstraintCheckerServices::getSymmetricChecker($services),
188
+			$config->get('WBQualityConstraintsInverseConstraintId')
189
+				=> ConstraintCheckerServices::getInverseChecker($services),
190
+			$config->get('WBQualityConstraintsUsedAsQualifierConstraintId')
191
+				=> ConstraintCheckerServices::getQualifierChecker($services),
192
+			$config->get('WBQualityConstraintsAllowedQualifiersConstraintId')
193
+				=> ConstraintCheckerServices::getQualifiersChecker($services),
194
+			$config->get('WBQualityConstraintsMandatoryQualifierConstraintId')
195
+				=> ConstraintCheckerServices::getMandatoryQualifiersChecker($services),
196
+			$config->get('WBQualityConstraintsRangeConstraintId')
197
+				=> ConstraintCheckerServices::getRangeChecker($services),
198
+			$config->get('WBQualityConstraintsDifferenceWithinRangeConstraintId')
199
+				=> ConstraintCheckerServices::getDiffWithinRangeChecker($services),
200
+			$config->get('WBQualityConstraintsTypeConstraintId')
201
+				=> ConstraintCheckerServices::getTypeChecker($services),
202
+			$config->get('WBQualityConstraintsValueTypeConstraintId')
203
+				=> ConstraintCheckerServices::getValueTypeChecker($services),
204
+			$config->get('WBQualityConstraintsSingleValueConstraintId')
205
+				=> ConstraintCheckerServices::getSingleValueChecker($services),
206
+			$config->get('WBQualityConstraintsMultiValueConstraintId')
207
+				=> ConstraintCheckerServices::getMultiValueChecker($services),
208
+			$config->get('WBQualityConstraintsDistinctValuesConstraintId')
209
+				=> ConstraintCheckerServices::getUniqueValueChecker($services),
210
+			$config->get('WBQualityConstraintsFormatConstraintId')
211
+				=> ConstraintCheckerServices::getFormatChecker($services),
212
+			$config->get('WBQualityConstraintsCommonsLinkConstraintId')
213
+				=> ConstraintCheckerServices::getCommonsLinkChecker($services),
214
+			$config->get('WBQualityConstraintsOneOfConstraintId')
215
+				=> ConstraintCheckerServices::getOneOfChecker($services),
216
+			$config->get('WBQualityConstraintsUsedForValuesOnlyConstraintId')
217
+				=> ConstraintCheckerServices::getValueOnlyChecker($services),
218
+			$config->get('WBQualityConstraintsUsedAsReferenceConstraintId')
219
+				=> ConstraintCheckerServices::getReferenceChecker($services),
220
+			$config->get('WBQualityConstraintsNoBoundsConstraintId')
221
+				=> ConstraintCheckerServices::getNoBoundsChecker($services),
222
+			$config->get('WBQualityConstraintsAllowedUnitsConstraintId')
223
+				=> ConstraintCheckerServices::getAllowedUnitsChecker($services),
224
+			$config->get('WBQualityConstraintsSingleBestValueConstraintId')
225
+				=> ConstraintCheckerServices::getSingleBestValueChecker($services),
226
+			$config->get('WBQualityConstraintsAllowedEntityTypesConstraintId')
227
+				=> ConstraintCheckerServices::getEntityTypeChecker($services),
228
+			$config->get('WBQualityConstraintsNoneOfConstraintId')
229
+				=> ConstraintCheckerServices::getNoneOfChecker($services),
230
+			$config->get('WBQualityConstraintsIntegerConstraintId')
231
+				=> ConstraintCheckerServices::getIntegerChecker($services),
232
+			$config->get('WBQualityConstraintsCitationNeededConstraintId')
233
+				=> ConstraintCheckerServices::getCitationNeededChecker($services),
234
+			$config->get('WBQualityConstraintsPropertyScopeConstraintId')
235
+				=> ConstraintCheckerServices::getPropertyScopeChecker($services),
236
+			$config->get('WBQualityConstraintsContemporaryConstraintId')
237
+				=> ConstraintCheckerServices::getContemporaryChecker($services),
238 238
 		];
239 239
 
240 240
 		return new DelegatingConstraintChecker(
241
-			WikibaseServices::getEntityLookup( $services ),
241
+			WikibaseServices::getEntityLookup($services),
242 242
 			$checkerMap,
243
-			ConstraintsServices::getConstraintLookup( $services ),
244
-			ConstraintsServices::getConstraintParameterParser( $services ),
243
+			ConstraintsServices::getConstraintLookup($services),
244
+			ConstraintsServices::getConstraintParameterParser($services),
245 245
 			$statementGuidParser,
246
-			ConstraintsServices::getLoggingHelper( $services ),
247
-			$config->get( 'WBQualityConstraintsCheckQualifiers' ),
248
-			$config->get( 'WBQualityConstraintsCheckReferences' ),
249
-			$config->get( 'WBQualityConstraintsPropertiesWithViolatingQualifiers' )
246
+			ConstraintsServices::getLoggingHelper($services),
247
+			$config->get('WBQualityConstraintsCheckQualifiers'),
248
+			$config->get('WBQualityConstraintsCheckReferences'),
249
+			$config->get('WBQualityConstraintsPropertiesWithViolatingQualifiers')
250 250
 		);
251 251
 	},
252 252
 
253
-	ConstraintsServices::RESULTS_SOURCE => function ( MediaWikiServices $services ) {
253
+	ConstraintsServices::RESULTS_SOURCE => function(MediaWikiServices $services) {
254 254
 		$config = $services->getMainConfig();
255 255
 		$resultsSource = new CheckingResultsSource(
256
-			ConstraintsServices::getDelegatingConstraintChecker( $services )
256
+			ConstraintsServices::getDelegatingConstraintChecker($services)
257 257
 		);
258 258
 
259 259
 		$cacheCheckConstraintsResults = false;
260 260
 
261
-		if ( $config->get( 'WBQualityConstraintsCacheCheckConstraintsResults' ) ) {
261
+		if ($config->get('WBQualityConstraintsCacheCheckConstraintsResults')) {
262 262
 			$cacheCheckConstraintsResults = true;
263 263
 			// check that we can use getLocalRepoWikiPageMetaDataAccessor()
264 264
 			// TODO we should always be able to cache constraint check results (T244726)
265
-			$entitySources = WikibaseRepo::getEntitySourceDefinitions( $services )->getSources();
266
-			$localEntitySourceName = WikibaseRepo::getLocalEntitySource( $services )->getSourceName();
265
+			$entitySources = WikibaseRepo::getEntitySourceDefinitions($services)->getSources();
266
+			$localEntitySourceName = WikibaseRepo::getLocalEntitySource($services)->getSourceName();
267 267
 
268
-			foreach ( $entitySources as $entitySource ) {
269
-				if ( $entitySource->getSourceName() !== $localEntitySourceName ) {
270
-					LoggerFactory::getInstance( 'WikibaseQualityConstraints' )->warning(
271
-						'Cannot cache constraint check results for non-local source: ' .
268
+			foreach ($entitySources as $entitySource) {
269
+				if ($entitySource->getSourceName() !== $localEntitySourceName) {
270
+					LoggerFactory::getInstance('WikibaseQualityConstraints')->warning(
271
+						'Cannot cache constraint check results for non-local source: '.
272 272
 						$entitySource->getSourceName()
273 273
 					);
274 274
 					$cacheCheckConstraintsResults = false;
@@ -277,29 +277,29 @@  discard block
 block discarded – undo
277 277
 			}
278 278
 		}
279 279
 
280
-		if ( $cacheCheckConstraintsResults ) {
280
+		if ($cacheCheckConstraintsResults) {
281 281
 			$possiblyStaleConstraintTypes = [
282
-				$config->get( 'WBQualityConstraintsCommonsLinkConstraintId' ),
283
-				$config->get( 'WBQualityConstraintsTypeConstraintId' ),
284
-				$config->get( 'WBQualityConstraintsValueTypeConstraintId' ),
285
-				$config->get( 'WBQualityConstraintsDistinctValuesConstraintId' ),
282
+				$config->get('WBQualityConstraintsCommonsLinkConstraintId'),
283
+				$config->get('WBQualityConstraintsTypeConstraintId'),
284
+				$config->get('WBQualityConstraintsValueTypeConstraintId'),
285
+				$config->get('WBQualityConstraintsDistinctValuesConstraintId'),
286 286
 			];
287 287
 			// TODO in the future, get WikiPageEntityMetaDataAccessor from $services?
288 288
 			$repo = WikibaseRepo::getDefaultInstance();
289
-			$entityIdParser = WikibaseRepo::getEntityIdParser( $services );
289
+			$entityIdParser = WikibaseRepo::getEntityIdParser($services);
290 290
 			$wikiPageEntityMetaDataAccessor = $repo->getLocalRepoWikiPageMetaDataAccessor();
291 291
 
292 292
 			$resultsSource = new CachingResultsSource(
293 293
 				$resultsSource,
294 294
 				ResultsCache::getDefaultInstance(),
295
-				ConstraintsServices::getCheckResultSerializer( $services ),
296
-				ConstraintsServices::getCheckResultDeserializer( $services ),
295
+				ConstraintsServices::getCheckResultSerializer($services),
296
+				ConstraintsServices::getCheckResultDeserializer($services),
297 297
 				$wikiPageEntityMetaDataAccessor,
298 298
 				$entityIdParser,
299
-				$config->get( 'WBQualityConstraintsCacheCheckConstraintsTTLSeconds' ),
299
+				$config->get('WBQualityConstraintsCacheCheckConstraintsTTLSeconds'),
300 300
 				$possiblyStaleConstraintTypes,
301
-				$config->get( 'WBQualityConstraintsCacheCheckConstraintsMaximumRevisionIds' ),
302
-				ConstraintsServices::getLoggingHelper( $services )
301
+				$config->get('WBQualityConstraintsCacheCheckConstraintsMaximumRevisionIds'),
302
+				ConstraintsServices::getLoggingHelper($services)
303 303
 			);
304 304
 		}
305 305
 
Please login to merge, or discard this patch.
src/Api/CheckConstraints.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 
83 83
 		$language = $repo->getUserLanguage();
84 84
 		$formatterOptions = new FormatterOptions();
85
-		$formatterOptions->setOption( SnakFormatter::OPT_LANG, $language->getCode() );
85
+		$formatterOptions->setOption(SnakFormatter::OPT_LANG, $language->getCode());
86 86
 		$valueFormatterFactory = $repo->getValueFormatterFactory();
87
-		$valueFormatter = $valueFormatterFactory->getValueFormatter( SnakFormatter::FORMAT_HTML, $formatterOptions );
87
+		$valueFormatter = $valueFormatterFactory->getValueFormatter(SnakFormatter::FORMAT_HTML, $formatterOptions);
88 88
 
89 89
 		$entityIdHtmlLinkFormatterFactory = $repo->getEntityIdHtmlLinkFormatterFactory();
90
-		$entityIdHtmlLinkFormatter = $entityIdHtmlLinkFormatterFactory->getEntityIdFormatter( $language );
90
+		$entityIdHtmlLinkFormatter = $entityIdHtmlLinkFormatterFactory->getEntityIdFormatter($language);
91 91
 		$entityIdLabelFormatterFactory = new EntityIdLabelFormatterFactory();
92
-		$entityIdLabelFormatter = $entityIdLabelFormatterFactory->getEntityIdFormatter( $language );
92
+		$entityIdLabelFormatter = $entityIdLabelFormatterFactory->getEntityIdFormatter($language);
93 93
 
94 94
 		$checkResultsRenderer = new CheckResultsRenderer(
95 95
 			$repo->getEntityTitleLookup(),
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 			$name,
108 108
 			$entityIdParser,
109 109
 			$statementGuidValidator,
110
-			$repo->getApiHelperFactory( RequestContext::getMain() ),
110
+			$repo->getApiHelperFactory(RequestContext::getMain()),
111 111
 			$resultsSource,
112 112
 			$checkResultsRenderer,
113 113
 			$dataFactory
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
 		CheckResultsRenderer $checkResultsRenderer,
135 135
 		IBufferingStatsdDataFactory $dataFactory
136 136
 	) {
137
-		parent::__construct( $main, $name );
137
+		parent::__construct($main, $name);
138 138
 		$this->entityIdParser = $entityIdParser;
139 139
 		$this->statementGuidValidator = $statementGuidValidator;
140
-		$this->resultBuilder = $apiHelperFactory->getResultBuilder( $this );
141
-		$this->errorReporter = $apiHelperFactory->getErrorReporter( $this );
140
+		$this->resultBuilder = $apiHelperFactory->getResultBuilder($this);
141
+		$this->errorReporter = $apiHelperFactory->getErrorReporter($this);
142 142
 		$this->resultsSource = $resultsSource;
143 143
 		$this->checkResultsRenderer = $checkResultsRenderer;
144 144
 		$this->dataFactory = $dataFactory;
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 
155 155
 		$params = $this->extractRequestParams();
156 156
 
157
-		$this->validateParameters( $params );
158
-		$entityIds = $this->parseEntityIds( $params );
159
-		$claimIds = $this->parseClaimIds( $params );
157
+		$this->validateParameters($params);
158
+		$entityIds = $this->parseEntityIds($params);
159
+		$claimIds = $this->parseClaimIds($params);
160 160
 		$constraintIDs = $params[self::PARAM_CONSTRAINT_ID];
161 161
 		$statuses = $params[self::PARAM_STATUS];
162 162
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 				)
173 173
 			)->getArray()
174 174
 		);
175
-		$this->resultBuilder->markSuccess( 1 );
175
+		$this->resultBuilder->markSuccess(1);
176 176
 	}
177 177
 
178 178
 	/**
@@ -180,24 +180,24 @@  discard block
 block discarded – undo
180 180
 	 *
181 181
 	 * @return EntityId[]
182 182
 	 */
183
-	private function parseEntityIds( array $params ) {
183
+	private function parseEntityIds(array $params) {
184 184
 		$ids = $params[self::PARAM_ID];
185 185
 
186
-		if ( $ids === null ) {
186
+		if ($ids === null) {
187 187
 			return [];
188
-		} elseif ( $ids === [] ) {
188
+		} elseif ($ids === []) {
189 189
 			$this->errorReporter->dieError(
190
-				'If ' . self::PARAM_ID . ' is specified, it must be nonempty.', 'no-data' );
190
+				'If '.self::PARAM_ID.' is specified, it must be nonempty.', 'no-data' );
191 191
 		}
192 192
 
193
-		return array_map( function ( $id ) {
193
+		return array_map(function($id) {
194 194
 			try {
195
-				return $this->entityIdParser->parse( $id );
196
-			} catch ( EntityIdParsingException $e ) {
195
+				return $this->entityIdParser->parse($id);
196
+			} catch (EntityIdParsingException $e) {
197 197
 				$this->errorReporter->dieError(
198
-					"Invalid id: $id", 'invalid-entity-id', 0, [ self::PARAM_ID => $id ] );
198
+					"Invalid id: $id", 'invalid-entity-id', 0, [self::PARAM_ID => $id] );
199 199
 			}
200
-		}, $ids );
200
+		}, $ids);
201 201
 	}
202 202
 
203 203
 	/**
@@ -205,35 +205,35 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 * @return string[]
207 207
 	 */
208
-	private function parseClaimIds( array $params ) {
208
+	private function parseClaimIds(array $params) {
209 209
 		$ids = $params[self::PARAM_CLAIM_ID];
210 210
 
211
-		if ( $ids === null ) {
211
+		if ($ids === null) {
212 212
 			return [];
213
-		} elseif ( $ids === [] ) {
213
+		} elseif ($ids === []) {
214 214
 			$this->errorReporter->dieError(
215
-				'If ' . self::PARAM_CLAIM_ID . ' is specified, it must be nonempty.', 'no-data' );
215
+				'If '.self::PARAM_CLAIM_ID.' is specified, it must be nonempty.', 'no-data' );
216 216
 		}
217 217
 
218
-		foreach ( $ids as $id ) {
219
-			if ( !$this->statementGuidValidator->validate( $id ) ) {
218
+		foreach ($ids as $id) {
219
+			if (!$this->statementGuidValidator->validate($id)) {
220 220
 				$this->errorReporter->dieError(
221
-					"Invalid claim id: $id", 'invalid-guid', 0, [ self::PARAM_CLAIM_ID => $id ] );
221
+					"Invalid claim id: $id", 'invalid-guid', 0, [self::PARAM_CLAIM_ID => $id] );
222 222
 			}
223 223
 		}
224 224
 
225 225
 		return $ids;
226 226
 	}
227 227
 
228
-	private function validateParameters( array $params ) {
229
-		if ( $params[self::PARAM_CONSTRAINT_ID] !== null
230
-			 && empty( $params[self::PARAM_CONSTRAINT_ID] )
228
+	private function validateParameters(array $params) {
229
+		if ($params[self::PARAM_CONSTRAINT_ID] !== null
230
+			 && empty($params[self::PARAM_CONSTRAINT_ID])
231 231
 		) {
232 232
 			$paramConstraintId = self::PARAM_CONSTRAINT_ID;
233 233
 			$this->errorReporter->dieError(
234 234
 				"If $paramConstraintId is specified, it must be nonempty.", 'no-data' );
235 235
 		}
236
-		if ( $params[self::PARAM_ID] === null && $params[self::PARAM_CLAIM_ID] === null ) {
236
+		if ($params[self::PARAM_ID] === null && $params[self::PARAM_CLAIM_ID] === null) {
237 237
 			$paramId = self::PARAM_ID;
238 238
 			$paramClaimId = self::PARAM_CLAIM_ID;
239 239
 			$this->errorReporter->dieError(
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 				],
275 275
 				ApiBase::PARAM_ISMULTI => true,
276 276
 				ApiBase::PARAM_ALL => true,
277
-				ApiBase::PARAM_DFLT => implode( '|', CachingResultsSource::CACHED_STATUSES ),
277
+				ApiBase::PARAM_DFLT => implode('|', CachingResultsSource::CACHED_STATUSES),
278 278
 				ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
279 279
 			],
280 280
 		];
Please login to merge, or discard this patch.