@@ -71,26 +71,26 @@ discard block |
||
71 | 71 | * @throws ConstraintParameterException |
72 | 72 | * @return CheckResult |
73 | 73 | */ |
74 | - public function checkConstraint( Context $context, Constraint $constraint ) { |
|
74 | + public function checkConstraint(Context $context, Constraint $constraint) { |
|
75 | 75 | $parameters = []; |
76 | 76 | $constraintParameters = $constraint->getConstraintParameters(); |
77 | 77 | |
78 | - $format = $this->constraintParameterParser->parseFormatParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
|
79 | - $parameters['pattern'] = [ $format ]; |
|
78 | + $format = $this->constraintParameterParser->parseFormatParameter($constraintParameters, $constraint->getConstraintTypeItemId()); |
|
79 | + $parameters['pattern'] = [$format]; |
|
80 | 80 | |
81 | 81 | $syntaxClarification = $this->constraintParameterParser->parseSyntaxClarificationParameter( |
82 | 82 | $constraintParameters, |
83 | 83 | WikibaseRepo::getDefaultInstance()->getUserLanguage() // TODO make this part of the Context? |
84 | 84 | ); |
85 | - if ( $syntaxClarification !== null ) { |
|
86 | - $parameters['clarification'] = [ $syntaxClarification ]; |
|
85 | + if ($syntaxClarification !== null) { |
|
86 | + $parameters['clarification'] = [$syntaxClarification]; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | $snak = $context->getSnak(); |
90 | 90 | |
91 | - if ( !$snak instanceof PropertyValueSnak ) { |
|
91 | + if (!$snak instanceof PropertyValueSnak) { |
|
92 | 92 | // nothing to check |
93 | - return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE, '' ); |
|
93 | + return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE, ''); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $dataValue = $snak->getDataValue(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * error handling: |
100 | 100 | * type of $dataValue for properties with 'Format' constraint has to be 'string' or 'monolingualtext' |
101 | 101 | */ |
102 | - switch ( $dataValue->getType() ) { |
|
102 | + switch ($dataValue->getType()) { |
|
103 | 103 | case 'string': |
104 | 104 | $text = $dataValue->getValue(); |
105 | 105 | break; |
@@ -108,60 +108,59 @@ discard block |
||
108 | 108 | $text = $dataValue->getText(); |
109 | 109 | break; |
110 | 110 | default: |
111 | - $message = wfMessage( "wbqc-violation-message-value-needed-of-type" ) |
|
111 | + $message = wfMessage("wbqc-violation-message-value-needed-of-type") |
|
112 | 112 | ->rawParams( |
113 | - $this->constraintParameterRenderer->formatItemId( $constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM ), |
|
114 | - wfMessage( 'datatypes-type-string' )->escaped(), |
|
115 | - wfMessage( 'datatypes-type-monolingualtext' )->escaped() |
|
113 | + $this->constraintParameterRenderer->formatItemId($constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM), |
|
114 | + wfMessage('datatypes-type-string')->escaped(), |
|
115 | + wfMessage('datatypes-type-monolingualtext')->escaped() |
|
116 | 116 | ) |
117 | 117 | ->escaped(); |
118 | - return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message ); |
|
118 | + return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message); |
|
119 | 119 | } |
120 | 120 | |
121 | - if ( $this->sparqlHelper !== null && $this->config->get( 'WBQualityConstraintsCheckFormatConstraint' ) ) { |
|
122 | - if ( $this->sparqlHelper->matchesRegularExpression( $text, $format ) ) { |
|
121 | + if ($this->sparqlHelper !== null && $this->config->get('WBQualityConstraintsCheckFormatConstraint')) { |
|
122 | + if ($this->sparqlHelper->matchesRegularExpression($text, $format)) { |
|
123 | 123 | $message = ''; |
124 | 124 | $status = CheckResult::STATUS_COMPLIANCE; |
125 | 125 | } else { |
126 | 126 | $message = wfMessage( |
127 | 127 | $syntaxClarification !== null ? |
128 | - 'wbqc-violation-message-format-clarification' : |
|
129 | - 'wbqc-violation-message-format' |
|
128 | + 'wbqc-violation-message-format-clarification' : 'wbqc-violation-message-format' |
|
130 | 129 | )->rawParams( |
131 | - $this->constraintParameterRenderer->formatEntityId( $context->getSnak()->getPropertyId(), Role::CONSTRAINT_PROPERTY ), |
|
132 | - $this->constraintParameterRenderer->formatDataValue( new StringValue( $text ), Role::OBJECT ), |
|
133 | - $this->constraintParameterRenderer->formatByRole( Role::CONSTRAINT_PARAMETER_VALUE, |
|
134 | - '<code><nowiki>' . htmlspecialchars( $format ) . '</nowiki></code>' ) |
|
130 | + $this->constraintParameterRenderer->formatEntityId($context->getSnak()->getPropertyId(), Role::CONSTRAINT_PROPERTY), |
|
131 | + $this->constraintParameterRenderer->formatDataValue(new StringValue($text), Role::OBJECT), |
|
132 | + $this->constraintParameterRenderer->formatByRole(Role::CONSTRAINT_PARAMETER_VALUE, |
|
133 | + '<code><nowiki>'.htmlspecialchars($format).'</nowiki></code>') |
|
135 | 134 | ); |
136 | - if ( $syntaxClarification !== null ) { |
|
137 | - $message->params( $syntaxClarification ); |
|
135 | + if ($syntaxClarification !== null) { |
|
136 | + $message->params($syntaxClarification); |
|
138 | 137 | } |
139 | 138 | $message = $message->escaped(); |
140 | 139 | $status = CheckResult::STATUS_VIOLATION; |
141 | 140 | } |
142 | 141 | } else { |
143 | - $message = wfMessage( "wbqc-violation-message-security-reason" ) |
|
144 | - ->rawParams( $this->constraintParameterRenderer->formatItemId( $constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM ) ) |
|
142 | + $message = wfMessage("wbqc-violation-message-security-reason") |
|
143 | + ->rawParams($this->constraintParameterRenderer->formatItemId($constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM)) |
|
145 | 144 | ->escaped(); |
146 | 145 | $status = CheckResult::STATUS_TODO; |
147 | 146 | } |
148 | - return new CheckResult( $context, $constraint, $parameters, $status, $message ); |
|
147 | + return new CheckResult($context, $constraint, $parameters, $status, $message); |
|
149 | 148 | } |
150 | 149 | |
151 | - public function checkConstraintParameters( Constraint $constraint ) { |
|
150 | + public function checkConstraintParameters(Constraint $constraint) { |
|
152 | 151 | $constraintParameters = $constraint->getConstraintParameters(); |
153 | 152 | $exceptions = []; |
154 | 153 | try { |
155 | - $this->constraintParameterParser->parseFormatParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
|
156 | - } catch ( ConstraintParameterException $e ) { |
|
154 | + $this->constraintParameterParser->parseFormatParameter($constraintParameters, $constraint->getConstraintTypeItemId()); |
|
155 | + } catch (ConstraintParameterException $e) { |
|
157 | 156 | $exceptions[] = $e; |
158 | 157 | } |
159 | 158 | try { |
160 | 159 | $this->constraintParameterParser->parseSyntaxClarificationParameter( |
161 | 160 | $constraintParameters, |
162 | - Language::factory( 'en' ) // errors are reported independent of language requested |
|
161 | + Language::factory('en') // errors are reported independent of language requested |
|
163 | 162 | ); |
164 | - } catch ( ConstraintParameterException $e ) { |
|
163 | + } catch (ConstraintParameterException $e) { |
|
165 | 164 | $exceptions[] = $e; |
166 | 165 | } |
167 | 166 | return $exceptions; |
@@ -82,35 +82,35 @@ discard block |
||
82 | 82 | * @throws SparqlHelperException if the checker uses SPARQL and the query times out or some other error occurs |
83 | 83 | * @return CheckResult |
84 | 84 | */ |
85 | - public function checkConstraint( Context $context, Constraint $constraint ) { |
|
86 | - if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) { |
|
87 | - return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED ); |
|
85 | + public function checkConstraint(Context $context, Constraint $constraint) { |
|
86 | + if ($context->getSnakRank() === Statement::RANK_DEPRECATED) { |
|
87 | + return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $parameters = []; |
91 | 91 | $constraintParameters = $constraint->getConstraintParameters(); |
92 | 92 | |
93 | - $classes = $this->constraintParameterParser->parseClassParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
|
93 | + $classes = $this->constraintParameterParser->parseClassParameter($constraintParameters, $constraint->getConstraintTypeItemId()); |
|
94 | 94 | $parameters['class'] = array_map( |
95 | - function( $id ) { |
|
96 | - return new ItemId( $id ); |
|
95 | + function($id) { |
|
96 | + return new ItemId($id); |
|
97 | 97 | }, |
98 | 98 | $classes |
99 | 99 | ); |
100 | 100 | |
101 | - $relation = $this->constraintParameterParser->parseRelationParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
|
102 | - if ( $relation === 'instance' ) { |
|
103 | - $relationId = $this->config->get( 'WBQualityConstraintsInstanceOfId' ); |
|
104 | - } elseif ( $relation === 'subclass' ) { |
|
105 | - $relationId = $this->config->get( 'WBQualityConstraintsSubclassOfId' ); |
|
101 | + $relation = $this->constraintParameterParser->parseRelationParameter($constraintParameters, $constraint->getConstraintTypeItemId()); |
|
102 | + if ($relation === 'instance') { |
|
103 | + $relationId = $this->config->get('WBQualityConstraintsInstanceOfId'); |
|
104 | + } elseif ($relation === 'subclass') { |
|
105 | + $relationId = $this->config->get('WBQualityConstraintsSubclassOfId'); |
|
106 | 106 | } |
107 | - $parameters['relation'] = [ $relation ]; |
|
107 | + $parameters['relation'] = [$relation]; |
|
108 | 108 | |
109 | 109 | $snak = $context->getSnak(); |
110 | 110 | |
111 | - if ( !$snak instanceof PropertyValueSnak ) { |
|
111 | + if (!$snak instanceof PropertyValueSnak) { |
|
112 | 112 | // nothing to check |
113 | - return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE, '' ); |
|
113 | + return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_COMPLIANCE, ''); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | $dataValue = $snak->getDataValue(); |
@@ -119,22 +119,22 @@ discard block |
||
119 | 119 | * error handling: |
120 | 120 | * type of $dataValue for properties with 'Value type' constraint has to be 'wikibase-entityid' |
121 | 121 | */ |
122 | - if ( $dataValue->getType() !== 'wikibase-entityid' ) { |
|
123 | - $message = wfMessage( "wbqc-violation-message-value-needed-of-type" ) |
|
122 | + if ($dataValue->getType() !== 'wikibase-entityid') { |
|
123 | + $message = wfMessage("wbqc-violation-message-value-needed-of-type") |
|
124 | 124 | ->rawParams( |
125 | - $this->constraintParameterRenderer->formatItemId( $constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM ), |
|
125 | + $this->constraintParameterRenderer->formatItemId($constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM), |
|
126 | 126 | 'wikibase-entityid' // TODO is there a message for this type so we can localize it? |
127 | 127 | ) |
128 | 128 | ->escaped(); |
129 | - return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message ); |
|
129 | + return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message); |
|
130 | 130 | } |
131 | 131 | /** @var EntityIdValue $dataValue */ |
132 | 132 | |
133 | - $item = $this->entityLookup->getEntity( $dataValue->getEntityId() ); |
|
133 | + $item = $this->entityLookup->getEntity($dataValue->getEntityId()); |
|
134 | 134 | |
135 | - if ( !( $item instanceof StatementListProvider ) ) { |
|
136 | - $message = wfMessage( "wbqc-violation-message-value-entity-must-exist" )->escaped(); |
|
137 | - return new CheckResult( $context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message ); |
|
135 | + if (!($item instanceof StatementListProvider)) { |
|
136 | + $message = wfMessage("wbqc-violation-message-value-entity-must-exist")->escaped(); |
|
137 | + return new CheckResult($context, $constraint, $parameters, CheckResult::STATUS_VIOLATION, $message); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $statements = $item->getStatements(); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $classes |
146 | 146 | ); |
147 | 147 | |
148 | - if ( $result->getBool() ) { |
|
148 | + if ($result->getBool()) { |
|
149 | 149 | $message = ''; |
150 | 150 | $status = CheckResult::STATUS_COMPLIANCE; |
151 | 151 | } else { |
@@ -159,21 +159,21 @@ discard block |
||
159 | 159 | $status = CheckResult::STATUS_VIOLATION; |
160 | 160 | } |
161 | 161 | |
162 | - return ( new CheckResult( $context, $constraint, $parameters, $status, $message ) ) |
|
163 | - ->withMetadata( $result->getMetadata() ); |
|
162 | + return (new CheckResult($context, $constraint, $parameters, $status, $message)) |
|
163 | + ->withMetadata($result->getMetadata()); |
|
164 | 164 | } |
165 | 165 | |
166 | - public function checkConstraintParameters( Constraint $constraint ) { |
|
166 | + public function checkConstraintParameters(Constraint $constraint) { |
|
167 | 167 | $constraintParameters = $constraint->getConstraintParameters(); |
168 | 168 | $exceptions = []; |
169 | 169 | try { |
170 | - $this->constraintParameterParser->parseClassParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
|
171 | - } catch ( ConstraintParameterException $e ) { |
|
170 | + $this->constraintParameterParser->parseClassParameter($constraintParameters, $constraint->getConstraintTypeItemId()); |
|
171 | + } catch (ConstraintParameterException $e) { |
|
172 | 172 | $exceptions[] = $e; |
173 | 173 | } |
174 | 174 | try { |
175 | - $this->constraintParameterParser->parseRelationParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
|
176 | - } catch ( ConstraintParameterException $e ) { |
|
175 | + $this->constraintParameterParser->parseRelationParameter($constraintParameters, $constraint->getConstraintTypeItemId()); |
|
176 | + } catch (ConstraintParameterException $e) { |
|
177 | 177 | $exceptions[] = $e; |
178 | 178 | } |
179 | 179 | return $exceptions; |
@@ -50,22 +50,22 @@ discard block |
||
50 | 50 | * @throws SparqlHelperException if the checker uses SPARQL and the query times out or some other error occurs |
51 | 51 | * @return CheckResult |
52 | 52 | */ |
53 | - public function checkConstraint( Context $context, Constraint $constraint ) { |
|
54 | - if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) { |
|
55 | - return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED ); |
|
53 | + public function checkConstraint(Context $context, Constraint $constraint) { |
|
54 | + if ($context->getSnakRank() === Statement::RANK_DEPRECATED) { |
|
55 | + return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | $parameters = []; |
59 | 59 | |
60 | - if ( $this->sparqlHelper !== null ) { |
|
61 | - if ( $context->getType() === 'statement' ) { |
|
60 | + if ($this->sparqlHelper !== null) { |
|
61 | + if ($context->getType() === 'statement') { |
|
62 | 62 | $result = $this->sparqlHelper->findEntitiesWithSameStatement( |
63 | 63 | $context->getSnakStatement(), |
64 | 64 | true // ignore deprecated statements |
65 | 65 | ); |
66 | 66 | } else { |
67 | - if ( $context->getSnak()->getType() !== 'value' ) { |
|
68 | - return new CheckResult( $context, $constraint, [], CheckResult::STATUS_COMPLIANCE ); |
|
67 | + if ($context->getSnak()->getType() !== 'value') { |
|
68 | + return new CheckResult($context, $constraint, [], CheckResult::STATUS_COMPLIANCE); |
|
69 | 69 | } |
70 | 70 | $result = $this->sparqlHelper->findEntitiesWithSameQualifierOrReference( |
71 | 71 | $context->getEntity()->getId(), |
@@ -78,29 +78,29 @@ discard block |
||
78 | 78 | $otherEntities = $result->getArray(); |
79 | 79 | $metadata = $result->getMetadata(); |
80 | 80 | |
81 | - if ( $otherEntities === [] ) { |
|
81 | + if ($otherEntities === []) { |
|
82 | 82 | $status = CheckResult::STATUS_COMPLIANCE; |
83 | 83 | $message = ''; |
84 | 84 | } else { |
85 | 85 | $status = CheckResult::STATUS_VIOLATION; |
86 | - $message = wfMessage( 'wbqc-violation-message-unique-value' ) |
|
87 | - ->numParams( count( $otherEntities ) ) |
|
88 | - ->rawParams( $this->constraintParameterRenderer->formatEntityIdList( $otherEntities, Role::SUBJECT ) ) |
|
86 | + $message = wfMessage('wbqc-violation-message-unique-value') |
|
87 | + ->numParams(count($otherEntities)) |
|
88 | + ->rawParams($this->constraintParameterRenderer->formatEntityIdList($otherEntities, Role::SUBJECT)) |
|
89 | 89 | ->escaped(); |
90 | 90 | } |
91 | 91 | } else { |
92 | 92 | $status = CheckResult::STATUS_TODO; |
93 | - $message = wfMessage( "wbqc-violation-message-not-yet-implemented" ) |
|
94 | - ->rawParams( $this->constraintParameterRenderer->formatItemId( $constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM ) ) |
|
93 | + $message = wfMessage("wbqc-violation-message-not-yet-implemented") |
|
94 | + ->rawParams($this->constraintParameterRenderer->formatItemId($constraint->getConstraintTypeItemId(), Role::CONSTRAINT_TYPE_ITEM)) |
|
95 | 95 | ->escaped(); |
96 | 96 | $metadata = Metadata::blank(); |
97 | 97 | } |
98 | 98 | |
99 | - return ( new CheckResult( $context, $constraint, $parameters, $status, $message ) ) |
|
100 | - ->withMetadata( $metadata ); |
|
99 | + return (new CheckResult($context, $constraint, $parameters, $status, $message)) |
|
100 | + ->withMetadata($metadata); |
|
101 | 101 | } |
102 | 102 | |
103 | - public function checkConstraintParameters( Constraint $constraint ) { |
|
103 | + public function checkConstraintParameters(Constraint $constraint) { |
|
104 | 104 | // no parameters |
105 | 105 | return []; |
106 | 106 | } |
@@ -67,22 +67,22 @@ discard block |
||
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 |
||
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 |
||
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; |