Completed
Push — master ( 296d48...58f7ad )
by
unknown
02:05
created
src/ConstraintCheck/Checker/ItemChecker.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -67,22 +67,22 @@  discard block
 block discarded – undo
67 67
 	 * @throws ConstraintParameterException
68 68
 	 * @return CheckResult
69 69
 	 */
70
-	public function checkConstraint( Context $context, Constraint $constraint ) {
71
-		if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) {
72
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED );
70
+	public function checkConstraint(Context $context, Constraint $constraint) {
71
+		if ($context->getSnakRank() === Statement::RANK_DEPRECATED) {
72
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED);
73 73
 		}
74
-		if ( $context->getType() !== Context::TYPE_STATEMENT ) {
74
+		if ($context->getType() !== Context::TYPE_STATEMENT) {
75 75
 			// TODO T175562
76
-			return new CheckResult( $context, $constraint, [], CheckResult::STATUS_NOT_MAIN_SNAK );
76
+			return new CheckResult($context, $constraint, [], CheckResult::STATUS_NOT_MAIN_SNAK);
77 77
 		}
78 78
 
79 79
 		$parameters = [];
80 80
 		$constraintParameters = $constraint->getConstraintParameters();
81 81
 
82
-		$propertyId = $this->constraintParameterParser->parsePropertyParameter( $constraintParameters, $constraint->getConstraintTypeItemId() );
83
-		$parameters['property'] = [ $propertyId ];
82
+		$propertyId = $this->constraintParameterParser->parsePropertyParameter($constraintParameters, $constraint->getConstraintTypeItemId());
83
+		$parameters['property'] = [$propertyId];
84 84
 
85
-		$items = $this->constraintParameterParser->parseItemsParameter( $constraintParameters, $constraint->getConstraintTypeItemId(), false );
85
+		$items = $this->constraintParameterParser->parseItemsParameter($constraintParameters, $constraint->getConstraintTypeItemId(), false);
86 86
 		$parameters['items'] = $items;
87 87
 
88 88
 		/*
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		 *   a) a property only
91 91
 		 *   b) a property and a number of items (each combination of property and item forming an individual claim)
92 92
 		 */
93
-		if ( $items === [] ) {
93
+		if ($items === []) {
94 94
 			$requiredStatement = $this->connectionCheckerHelper->findStatementWithProperty(
95 95
 				$context->getEntity()->getStatements(),
96 96
 				$propertyId
@@ -103,35 +103,35 @@  discard block
 block discarded – undo
103 103
 			);
104 104
 		}
105 105
 
106
-		if ( $requiredStatement !== null ) {
106
+		if ($requiredStatement !== null) {
107 107
 			$status = CheckResult::STATUS_COMPLIANCE;
108 108
 			$message = '';
109 109
 		} else {
110 110
 			$status = CheckResult::STATUS_VIOLATION;
111
-			$message = wfMessage( 'wbqc-violation-message-item' );
111
+			$message = wfMessage('wbqc-violation-message-item');
112 112
 			$message->rawParams(
113
-				$this->constraintParameterRenderer->formatEntityId( $context->getSnak()->getPropertyId(), Role::CONSTRAINT_PROPERTY ),
114
-				$this->constraintParameterRenderer->formatEntityId( $propertyId, Role::PREDICATE )
113
+				$this->constraintParameterRenderer->formatEntityId($context->getSnak()->getPropertyId(), Role::CONSTRAINT_PROPERTY),
114
+				$this->constraintParameterRenderer->formatEntityId($propertyId, Role::PREDICATE)
115 115
 			);
116
-			$message->numParams( count( $items ) );
117
-			$message->rawParams( $this->constraintParameterRenderer->formatItemIdSnakValueList( $items, Role::OBJECT ) );
116
+			$message->numParams(count($items));
117
+			$message->rawParams($this->constraintParameterRenderer->formatItemIdSnakValueList($items, Role::OBJECT));
118 118
 			$message = $message->escaped();
119 119
 		}
120 120
 
121
-		return new CheckResult( $context, $constraint, $parameters, $status, $message );
121
+		return new CheckResult($context, $constraint, $parameters, $status, $message);
122 122
 	}
123 123
 
124
-	public function checkConstraintParameters( Constraint $constraint ) {
124
+	public function checkConstraintParameters(Constraint $constraint) {
125 125
 		$constraintParameters = $constraint->getConstraintParameters();
126 126
 		$exceptions = [];
127 127
 		try {
128
-			$this->constraintParameterParser->parsePropertyParameter( $constraintParameters, $constraint->getConstraintTypeItemId() );
129
-		} catch ( ConstraintParameterException $e ) {
128
+			$this->constraintParameterParser->parsePropertyParameter($constraintParameters, $constraint->getConstraintTypeItemId());
129
+		} catch (ConstraintParameterException $e) {
130 130
 			$exceptions[] = $e;
131 131
 		}
132 132
 		try {
133
-			$this->constraintParameterParser->parseItemsParameter( $constraintParameters, $constraint->getConstraintTypeItemId(), false );
134
-		} catch ( ConstraintParameterException $e ) {
133
+			$this->constraintParameterParser->parseItemsParameter($constraintParameters, $constraint->getConstraintTypeItemId(), false);
134
+		} catch (ConstraintParameterException $e) {
135 135
 			$exceptions[] = $e;
136 136
 		}
137 137
 		return $exceptions;
Please login to merge, or discard this patch.