Completed
Push — master ( 4301d4...442da4 )
by
unknown
04:40
created
src/ConstraintCheck/ConstraintChecker.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 * @throws ConstraintParameterException if the constraint parameters are invalid
23 23
 	 * @throws SparqlHelperException if the checker uses SPARQL and the query times out or some other error occurs
24 24
 	 */
25
-	public function checkConstraint( Context $context, Constraint $constraint );
25
+	public function checkConstraint(Context $context, Constraint $constraint);
26 26
 
27 27
 	/**
28 28
 	 * Check if the constraint parameters of $constraint are valid.
@@ -33,6 +33,6 @@  discard block
 block discarded – undo
33 33
 	 *
34 34
 	 * @return ConstraintParameterException[]
35 35
 	 */
36
-	public function checkConstraintParameters( Constraint $constraint );
36
+	public function checkConstraintParameters(Constraint $constraint);
37 37
 
38 38
 }
Please login to merge, or discard this patch.
src/ConstraintCheck/Checker/QualifierChecker.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@
 block discarded – undo
28 28
 	 *
29 29
 	 * @return CheckResult
30 30
 	 */
31
-	public function checkConstraint( Context $context, Constraint $constraint ) {
32
-		if ( $context->getType() === Context::TYPE_QUALIFIER ) {
33
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_COMPLIANCE, '' );
31
+	public function checkConstraint(Context $context, Constraint $constraint) {
32
+		if ($context->getType() === Context::TYPE_QUALIFIER) {
33
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_COMPLIANCE, '');
34 34
 		} else {
35
-			$message = wfMessage( 'wbqc-violation-message-qualifier' )->escaped();
36
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_VIOLATION, $message );
35
+			$message = wfMessage('wbqc-violation-message-qualifier')->escaped();
36
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_VIOLATION, $message);
37 37
 		}
38 38
 	}
39 39
 
40
-	public function checkConstraintParameters( Constraint $constraint ) {
40
+	public function checkConstraintParameters(Constraint $constraint) {
41 41
 		// no parameters
42 42
 		return [];
43 43
 	}
Please login to merge, or discard this patch.
src/ConstraintCheck/Helper/SparqlHelperException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 class SparqlHelperException extends RuntimeException {
11 11
 
12 12
 	public function __construct() {
13
-		parent::__construct( 'The SPARQL query endpoint returned an error.' );
13
+		parent::__construct('The SPARQL query endpoint returned an error.');
14 14
 	}
15 15
 
16 16
 }
Please login to merge, or discard this patch.
src/ConstraintCheck/Helper/ConstraintParameterException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 	/**
17 17
 	 * @param string $message HTML
18 18
 	 */
19
-	public function __construct( $message ) {
20
-		parent::__construct( $message );
19
+	public function __construct($message) {
20
+		parent::__construct($message);
21 21
 	}
22 22
 
23 23
 }
Please login to merge, or discard this patch.
src/ConstraintCheck/Helper/LoggingHelper.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 		$this->dataFactory = $dataFactory;
49 49
 		$this->logger = $logger;
50 50
 		$this->constraintCheckDurationLimits = [
51
-			'info' => $config->get( 'WBQualityConstraintsCheckDurationInfoSeconds' ),
52
-			'warning' => $config->get( 'WBQualityConstraintsCheckDurationWarningSeconds' ),
51
+			'info' => $config->get('WBQualityConstraintsCheckDurationInfoSeconds'),
52
+			'warning' => $config->get('WBQualityConstraintsCheckDurationWarningSeconds'),
53 53
 		];
54 54
 	}
55 55
 
@@ -75,41 +75,41 @@  discard block
 block discarded – undo
75 75
 		$durationSeconds,
76 76
 		$method
77 77
 	) {
78
-		$constraintCheckerClassShortName = substr( strrchr( $constraintCheckerClass, '\\' ), 1 );
78
+		$constraintCheckerClassShortName = substr(strrchr($constraintCheckerClass, '\\'), 1);
79 79
 		$constraintTypeItemId = $constraint->getConstraintTypeItemId();
80 80
 
81 81
 		$this->dataFactory->timing(
82
-			'wikibase.quality.constraints.check.timing.' .
83
-				$constraintTypeItemId . '-' .
82
+			'wikibase.quality.constraints.check.timing.'.
83
+				$constraintTypeItemId.'-'.
84 84
 				$constraintCheckerClassShortName,
85 85
 			$durationSeconds * 1000
86 86
 		);
87 87
 
88 88
 		// find the longest limit (and associated log level) that the duration exceeds
89
-		foreach ( $this->constraintCheckDurationLimits as $level => $limit ) {
89
+		foreach ($this->constraintCheckDurationLimits as $level => $limit) {
90 90
 			if (
91 91
 				// duration exceeds this limit
92
-				isset( $limit ) && $durationSeconds > $limit &&
92
+				isset($limit) && $durationSeconds > $limit &&
93 93
 				// this limit is longer than previous longest limit
94
-				( !isset( $limitSeconds ) || $limit > $limitSeconds )
94
+				(!isset($limitSeconds) || $limit > $limitSeconds)
95 95
 			) {
96 96
 				$limitSeconds = $limit;
97 97
 				$logLevel = $level;
98 98
 			}
99 99
 		}
100 100
 
101
-		if ( !isset( $limitSeconds ) ) {
101
+		if (!isset($limitSeconds)) {
102 102
 			return;
103 103
 		}
104
-		if ( $context->getType() !== Context::TYPE_STATEMENT ) {
104
+		if ($context->getType() !== Context::TYPE_STATEMENT) {
105 105
 			// TODO log less details but still log something
106 106
 			return;
107 107
 		}
108 108
 
109 109
 		$this->logger->log(
110 110
 			$logLevel,
111
-			'Constraint check with {constraintCheckerClassShortName} ' .
112
-			'took longer than {limitSeconds} second(s) ' .
111
+			'Constraint check with {constraintCheckerClassShortName} '.
112
+			'took longer than {limitSeconds} second(s) '.
113 113
 			'(duration: {durationSeconds} seconds).',
114 114
 			[
115 115
 				'method' => $method,
Please login to merge, or discard this patch.
src/ConstraintCheck/Result/CheckResult.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
 	public function getDataValue() {
147 147
 		$mainSnak = $this->context->getSnak();
148 148
 
149
-		if ( $mainSnak instanceof PropertyValueSnak ) {
149
+		if ($mainSnak instanceof PropertyValueSnak) {
150 150
 			return $mainSnak->getDataValue();
151 151
 		}
152 152
 
153
-		throw new LogicException( 'Cannot get DataValue, Snak is of type ' . $this->getSnakType() . '.' );
153
+		throw new LogicException('Cannot get DataValue, Snak is of type '.$this->getSnakType().'.');
154 154
 	}
155 155
 
156 156
 	/**
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	 * @param string $key
179 179
 	 * @param string $value
180 180
 	 */
181
-	public function addParameter( $key, $value ) {
181
+	public function addParameter($key, $value) {
182 182
 		$this->parameters[$key][] = $value;
183 183
 	}
184 184
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	/**
193 193
 	 * @param string $status
194 194
 	 */
195
-	public function setStatus( $status ) {
195
+	public function setStatus($status) {
196 196
 		$this->status = $status;
197 197
 	}
198 198
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 * @param Metadata $cm
208 208
 	 * @return self
209 209
 	 */
210
-	public function withMetadata( Metadata $cm ) {
210
+	public function withMetadata(Metadata $cm) {
211 211
 		$this->metadata = $cm;
212 212
 		return $this;
213 213
 	}
Please login to merge, or discard this patch.
src/ConstraintCheck/Cache/CachedArray.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 	 */
21 21
 	private $metadata;
22 22
 
23
-	public function __construct( array $array, Metadata $metadata ) {
23
+	public function __construct(array $array, Metadata $metadata) {
24 24
 		$this->array = $array;
25 25
 		$this->metadata = $metadata;
26 26
 	}
Please login to merge, or discard this patch.
src/ConstraintCheck/Cache/DependencyMetadata.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @param EntityId $entityId An entity ID from which the value was derived.
30 30
 	 * @return self Indication that a value is was derived from the entity with the given ID.
31 31
 	 */
32
-	public static function ofEntityId( EntityId $entityId ) {
32
+	public static function ofEntityId(EntityId $entityId) {
33 33
 		$ret = new self;
34 34
 		$ret->entityIds[] = $entityId;
35 35
 		return $ret;
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 	 * @param self[] $metadatas
40 40
 	 * @return self
41 41
 	 */
42
-	public static function merge( array $metadatas ) {
43
-		Assert::parameterElementType( self::class, $metadatas, '$metadatas' );
42
+	public static function merge(array $metadatas) {
43
+		Assert::parameterElementType(self::class, $metadatas, '$metadatas');
44 44
 		$ret = new self;
45
-		foreach ( $metadatas as $metadata ) {
46
-			$ret->entityIds = array_merge( $ret->entityIds, $metadata->entityIds );
45
+		foreach ($metadatas as $metadata) {
46
+			$ret->entityIds = array_merge($ret->entityIds, $metadata->entityIds);
47 47
 		}
48 48
 		return $ret;
49 49
 	}
Please login to merge, or discard this patch.
src/ConstraintCheck/Cache/CachedBool.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 	 * @param bool $bool
25 25
 	 * @param Metadata $metadata
26 26
 	 */
27
-	public function __construct( $bool, Metadata $metadata ) {
27
+	public function __construct($bool, Metadata $metadata) {
28 28
 		$this->bool = $bool;
29 29
 		$this->metadata = $metadata;
30 30
 	}
Please login to merge, or discard this patch.