Completed
Push — master ( 4ba9da...7f5e0a )
by
unknown
48s queued 14s
created
src/ConstraintCheck/Checker/LabelInLanguageChecker.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Checker;
6 6
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 	private ConstraintParameterParser $constraintParameterParser;
24 24
 
25
-	public function __construct( ConstraintParameterParser $constraintParameterParser ) {
25
+	public function __construct(ConstraintParameterParser $constraintParameterParser) {
26 26
 		$this->constraintParameterParser = $constraintParameterParser;
27 27
 	}
28 28
 
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @throws ConstraintParameterException
66 66
 	 */
67
-	public function checkConstraint( Context $context, Constraint $constraint ): CheckResult {
68
-		if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) {
69
-			return new CheckResult( $context, $constraint, CheckResult::STATUS_DEPRECATED );
67
+	public function checkConstraint(Context $context, Constraint $constraint): CheckResult {
68
+		if ($context->getSnakRank() === Statement::RANK_DEPRECATED) {
69
+			return new CheckResult($context, $constraint, CheckResult::STATUS_DEPRECATED);
70 70
 		}
71 71
 
72 72
 		$constraintParameters = $constraint->getConstraintParameters();
@@ -77,21 +77,21 @@  discard block
 block discarded – undo
77 77
 		);
78 78
 
79 79
 		$status = CheckResult::STATUS_VIOLATION;
80
-		$message = ( new ViolationMessage( 'wbqc-violation-message-label-lacking' ) )
81
-			->withEntityId( $context->getSnak()->getPropertyId(), Role::PREDICATE )
82
-			->withLanguages( $languages );
80
+		$message = (new ViolationMessage('wbqc-violation-message-label-lacking'))
81
+			->withEntityId($context->getSnak()->getPropertyId(), Role::PREDICATE)
82
+			->withLanguages($languages);
83 83
 
84 84
 		/** @var LabelsProvider $entity */
85 85
 		$entity = $context->getEntity();
86 86
 		'@phan-var LabelsProvider $entity';
87 87
 		$labels = $entity->getLabels();
88 88
 
89
-		if ( $labels->hasTermForLanguage( 'mul' ) ) {
89
+		if ($labels->hasTermForLanguage('mul')) {
90 90
 			$message = null;
91 91
 			$status = CheckResult::STATUS_COMPLIANCE;
92 92
 		} else {
93
-			foreach ( $languages as $language ) {
94
-				if ( $labels->hasTermForLanguage( $language ) ) {
93
+			foreach ($languages as $language) {
94
+				if ($labels->hasTermForLanguage($language)) {
95 95
 					$message = null;
96 96
 					$status = CheckResult::STATUS_COMPLIANCE;
97 97
 					break;
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 			}
100 100
 		}
101 101
 
102
-		return new CheckResult( $context, $constraint, $status, $message );
102
+		return new CheckResult($context, $constraint, $status, $message);
103 103
 	}
104 104
 
105
-	public function checkConstraintParameters( Constraint $constraint ): array {
105
+	public function checkConstraintParameters(Constraint $constraint): array {
106 106
 		$constraintParameters = $constraint->getConstraintParameters();
107 107
 		$exceptions = [];
108 108
 		try {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 				$constraintParameters,
111 111
 				$constraint->getConstraintTypeItemId()
112 112
 			);
113
-		} catch ( ConstraintParameterException $e ) {
113
+		} catch (ConstraintParameterException $e) {
114 114
 			$exceptions[] = $e;
115 115
 		}
116 116
 		return $exceptions;
Please login to merge, or discard this patch.