@@ -74,22 +74,22 @@ discard block |
||
74 | 74 | * @throws SparqlHelperException if the checker uses SPARQL and the query times out or some other error occurs |
75 | 75 | * @return CheckResult |
76 | 76 | */ |
77 | - public function checkConstraint( Context $context, Constraint $constraint ) { |
|
78 | - if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) { |
|
79 | - return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED ); |
|
77 | + public function checkConstraint(Context $context, Constraint $constraint) { |
|
78 | + if ($context->getSnakRank() === Statement::RANK_DEPRECATED) { |
|
79 | + return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | $parameters = []; |
83 | 83 | |
84 | - if ( $this->sparqlHelper !== null ) { |
|
85 | - if ( $context->getType() === 'statement' ) { |
|
84 | + if ($this->sparqlHelper !== null) { |
|
85 | + if ($context->getType() === 'statement') { |
|
86 | 86 | $result = $this->sparqlHelper->findEntitiesWithSameStatement( |
87 | 87 | $context->getSnakStatement(), |
88 | 88 | true // ignore deprecated statements |
89 | 89 | ); |
90 | 90 | } else { |
91 | - if ( $context->getSnak()->getType() !== 'value' ) { |
|
92 | - return new CheckResult( $context, $constraint, [], CheckResult::STATUS_COMPLIANCE ); |
|
91 | + if ($context->getSnak()->getType() !== 'value') { |
|
92 | + return new CheckResult($context, $constraint, [], CheckResult::STATUS_COMPLIANCE); |
|
93 | 93 | } |
94 | 94 | $result = $this->sparqlHelper->findEntitiesWithSameQualifierOrReference( |
95 | 95 | $context->getEntity()->getId(), |
@@ -102,27 +102,27 @@ discard block |
||
102 | 102 | $otherEntities = $result->getArray(); |
103 | 103 | $metadata = $result->getMetadata(); |
104 | 104 | |
105 | - if ( $otherEntities === [] ) { |
|
105 | + if ($otherEntities === []) { |
|
106 | 106 | $status = CheckResult::STATUS_COMPLIANCE; |
107 | 107 | $message = null; |
108 | 108 | } else { |
109 | - $otherEntities = array_values( array_filter( $otherEntities ) ); // remove nulls |
|
109 | + $otherEntities = array_values(array_filter($otherEntities)); // remove nulls |
|
110 | 110 | $status = CheckResult::STATUS_VIOLATION; |
111 | - $message = ( new ViolationMessage( 'wbqc-violation-message-unique-value' ) ) |
|
112 | - ->withEntityIdList( $otherEntities, Role::SUBJECT ); |
|
111 | + $message = (new ViolationMessage('wbqc-violation-message-unique-value')) |
|
112 | + ->withEntityIdList($otherEntities, Role::SUBJECT); |
|
113 | 113 | } |
114 | 114 | } else { |
115 | 115 | $status = CheckResult::STATUS_TODO; |
116 | - $message = ( new ViolationMessage( 'wbqc-violation-message-not-yet-implemented' ) ) |
|
117 | - ->withEntityId( new ItemId( $constraint->getConstraintTypeItemId() ), Role::CONSTRAINT_TYPE_ITEM ); |
|
116 | + $message = (new ViolationMessage('wbqc-violation-message-not-yet-implemented')) |
|
117 | + ->withEntityId(new ItemId($constraint->getConstraintTypeItemId()), Role::CONSTRAINT_TYPE_ITEM); |
|
118 | 118 | $metadata = Metadata::blank(); |
119 | 119 | } |
120 | 120 | |
121 | - return ( new CheckResult( $context, $constraint, $parameters, $status, $message ) ) |
|
122 | - ->withMetadata( $metadata ); |
|
121 | + return (new CheckResult($context, $constraint, $parameters, $status, $message)) |
|
122 | + ->withMetadata($metadata); |
|
123 | 123 | } |
124 | 124 | |
125 | - public function checkConstraintParameters( Constraint $constraint ) { |
|
125 | + public function checkConstraintParameters(Constraint $constraint) { |
|
126 | 126 | // no parameters |
127 | 127 | return []; |
128 | 128 | } |
@@ -89,23 +89,23 @@ discard block |
||
89 | 89 | * @return bool |
90 | 90 | * @throws OverflowException if $entitiesChecked exceeds the configured limit |
91 | 91 | */ |
92 | - private function isSubclassOf( EntityId $comparativeClass, array $classesToCheck, &$entitiesChecked = 0 ) { |
|
93 | - $maxEntities = $this->config->get( 'WBQualityConstraintsTypeCheckMaxEntities' ); |
|
92 | + private function isSubclassOf(EntityId $comparativeClass, array $classesToCheck, &$entitiesChecked = 0) { |
|
93 | + $maxEntities = $this->config->get('WBQualityConstraintsTypeCheckMaxEntities'); |
|
94 | 94 | if ( ++$entitiesChecked > $maxEntities ) { |
95 | - throw new OverflowException( 'Too many entities to check' ); |
|
95 | + throw new OverflowException('Too many entities to check'); |
|
96 | 96 | } |
97 | 97 | |
98 | - $item = $this->entityLookup->getEntity( $comparativeClass ); |
|
99 | - if ( !( $item instanceof StatementListProvider ) ) { |
|
98 | + $item = $this->entityLookup->getEntity($comparativeClass); |
|
99 | + if (!($item instanceof StatementListProvider)) { |
|
100 | 100 | return false; // lookup failed, probably because item doesn't exist |
101 | 101 | } |
102 | 102 | |
103 | - $subclassId = $this->config->get( 'WBQualityConstraintsSubclassOfId' ); |
|
103 | + $subclassId = $this->config->get('WBQualityConstraintsSubclassOfId'); |
|
104 | 104 | /** @var Statement $statement */ |
105 | - foreach ( $item->getStatements()->getByPropertyId( new PropertyId( $subclassId ) ) as $statement ) { |
|
105 | + foreach ($item->getStatements()->getByPropertyId(new PropertyId($subclassId)) as $statement) { |
|
106 | 106 | $mainSnak = $statement->getMainSnak(); |
107 | 107 | |
108 | - if ( !( $this->hasCorrectType( $mainSnak ) ) ) { |
|
108 | + if (!($this->hasCorrectType($mainSnak))) { |
|
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | /** @var PropertyValueSnak $mainSnak */ |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | $dataValue = $mainSnak->getDataValue(); |
115 | 115 | $comparativeClass = $dataValue->getEntityId(); |
116 | 116 | |
117 | - if ( in_array( $comparativeClass->getSerialization(), $classesToCheck ) ) { |
|
117 | + if (in_array($comparativeClass->getSerialization(), $classesToCheck)) { |
|
118 | 118 | return true; |
119 | 119 | } |
120 | 120 | |
121 | - if ( $this->isSubclassOf( $comparativeClass, $classesToCheck, $entitiesChecked ) ) { |
|
121 | + if ($this->isSubclassOf($comparativeClass, $classesToCheck, $entitiesChecked)) { |
|
122 | 122 | return true; |
123 | 123 | } |
124 | 124 | } |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | * @return CachedBool |
140 | 140 | * @throws SparqlHelperException if SPARQL is used and the query times out or some other error occurs |
141 | 141 | */ |
142 | - public function isSubclassOfWithSparqlFallback( EntityId $comparativeClass, array $classesToCheck ) { |
|
142 | + public function isSubclassOfWithSparqlFallback(EntityId $comparativeClass, array $classesToCheck) { |
|
143 | 143 | try { |
144 | 144 | return new CachedBool( |
145 | - $this->isSubclassOf( $comparativeClass, $classesToCheck ), |
|
145 | + $this->isSubclassOf($comparativeClass, $classesToCheck), |
|
146 | 146 | Metadata::blank() |
147 | 147 | ); |
148 | - } catch ( OverflowException $e ) { |
|
149 | - if ( $this->sparqlHelper !== null ) { |
|
148 | + } catch (OverflowException $e) { |
|
149 | + if ($this->sparqlHelper !== null) { |
|
150 | 150 | $this->dataFactory->increment( |
151 | 151 | 'wikibase.quality.constraints.sparql.typeFallback' |
152 | 152 | ); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | /* withInstance = */ false |
157 | 157 | ); |
158 | 158 | } else { |
159 | - return new CachedBool( false, Metadata::blank() ); |
|
159 | + return new CachedBool(false, Metadata::blank()); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | } |
@@ -174,14 +174,14 @@ discard block |
||
174 | 174 | * @return CachedBool |
175 | 175 | * @throws SparqlHelperException if SPARQL is used and the query times out or some other error occurs |
176 | 176 | */ |
177 | - public function hasClassInRelation( StatementList $statements, array $relationIds, array $classesToCheck ) { |
|
177 | + public function hasClassInRelation(StatementList $statements, array $relationIds, array $classesToCheck) { |
|
178 | 178 | $metadatas = []; |
179 | 179 | |
180 | 180 | /** @var Statement $statement */ |
181 | - foreach ( $this->getStatementsByPropertyIds( $statements, $relationIds ) as $statement ) { |
|
181 | + foreach ($this->getStatementsByPropertyIds($statements, $relationIds) as $statement) { |
|
182 | 182 | $mainSnak = $statement->getMainSnak(); |
183 | 183 | |
184 | - if ( !$this->hasCorrectType( $mainSnak ) ) { |
|
184 | + if (!$this->hasCorrectType($mainSnak)) { |
|
185 | 185 | continue; |
186 | 186 | } |
187 | 187 | /** @var PropertyValueSnak $mainSnak */ |
@@ -190,28 +190,28 @@ discard block |
||
190 | 190 | $dataValue = $mainSnak->getDataValue(); |
191 | 191 | $comparativeClass = $dataValue->getEntityId(); |
192 | 192 | |
193 | - if ( in_array( $comparativeClass->getSerialization(), $classesToCheck ) ) { |
|
193 | + if (in_array($comparativeClass->getSerialization(), $classesToCheck)) { |
|
194 | 194 | // discard $metadatas, we know this is fresh |
195 | - return new CachedBool( true, Metadata::blank() ); |
|
195 | + return new CachedBool(true, Metadata::blank()); |
|
196 | 196 | } |
197 | 197 | |
198 | - $result = $this->isSubclassOfWithSparqlFallback( $comparativeClass, $classesToCheck ); |
|
198 | + $result = $this->isSubclassOfWithSparqlFallback($comparativeClass, $classesToCheck); |
|
199 | 199 | $metadatas[] = $result->getMetadata(); |
200 | - if ( $result->getBool() ) { |
|
200 | + if ($result->getBool()) { |
|
201 | 201 | return new CachedBool( |
202 | 202 | true, |
203 | - Metadata::merge( $metadatas ) |
|
203 | + Metadata::merge($metadatas) |
|
204 | 204 | ); |
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
208 | 208 | return new CachedBool( |
209 | 209 | false, |
210 | - Metadata::merge( $metadatas ) |
|
210 | + Metadata::merge($metadatas) |
|
211 | 211 | ); |
212 | 212 | } |
213 | 213 | |
214 | - private function hasCorrectType( Snak $mainSnak ) { |
|
214 | + private function hasCorrectType(Snak $mainSnak) { |
|
215 | 215 | return $mainSnak instanceof PropertyValueSnak |
216 | 216 | && $mainSnak->getDataValue()->getType() === 'wikibase-entityid'; |
217 | 217 | } |
@@ -226,12 +226,12 @@ discard block |
||
226 | 226 | array $propertyIdSerializations |
227 | 227 | ) { |
228 | 228 | $statementArrays = []; |
229 | - foreach ( $propertyIdSerializations as $propertyIdSerialization ) { |
|
230 | - $propertyId = new PropertyId( $propertyIdSerialization ); |
|
231 | - $statementArrays[] = $statements->getByPropertyId( $propertyId )->toArray(); |
|
229 | + foreach ($propertyIdSerializations as $propertyIdSerialization) { |
|
230 | + $propertyId = new PropertyId($propertyIdSerialization); |
|
231 | + $statementArrays[] = $statements->getByPropertyId($propertyId)->toArray(); |
|
232 | 232 | } |
233 | 233 | return new StatementList( |
234 | - call_user_func_array( 'array_merge', $statementArrays ) |
|
234 | + call_user_func_array('array_merge', $statementArrays) |
|
235 | 235 | ); |
236 | 236 | } |
237 | 237 | |
@@ -244,10 +244,10 @@ discard block |
||
244 | 244 | * |
245 | 245 | * @return ViolationMessage |
246 | 246 | */ |
247 | - public function getViolationMessage( PropertyId $propertyId, EntityId $entityId, array $classes, $checker, $relation ) { |
|
247 | + public function getViolationMessage(PropertyId $propertyId, EntityId $entityId, array $classes, $checker, $relation) { |
|
248 | 248 | $classes = array_map( |
249 | - function( $itemIdSerialization ) { |
|
250 | - return new ItemId( $itemIdSerialization ); |
|
249 | + function($itemIdSerialization) { |
|
250 | + return new ItemId($itemIdSerialization); |
|
251 | 251 | }, |
252 | 252 | $classes |
253 | 253 | ); |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | // wbqc-violation-message-valueType-instance |
260 | 260 | // wbqc-violation-message-valueType-subclass |
261 | 261 | // wbqc-violation-message-valueType-instanceOrSubclass |
262 | - return ( new ViolationMessage( 'wbqc-violation-message-' . $checker . '-' . $relation ) ) |
|
263 | - ->withEntityId( $propertyId, Role::CONSTRAINT_PROPERTY ) |
|
264 | - ->withEntityId( $entityId, Role::SUBJECT ) |
|
265 | - ->withEntityIdList( $classes, Role::OBJECT ); |
|
262 | + return (new ViolationMessage('wbqc-violation-message-'.$checker.'-'.$relation)) |
|
263 | + ->withEntityId($propertyId, Role::CONSTRAINT_PROPERTY) |
|
264 | + ->withEntityId($entityId, Role::SUBJECT) |
|
265 | + ->withEntityIdList($classes, Role::OBJECT); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | } |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | public function __construct( |
60 | 60 | $messageKey |
61 | 61 | ) { |
62 | - if ( strpos( $messageKey, self::MESSAGE_KEY_PREFIX ) !== 0 ) { |
|
62 | + if (strpos($messageKey, self::MESSAGE_KEY_PREFIX) !== 0) { |
|
63 | 63 | throw new InvalidArgumentException( |
64 | - 'ViolationMessage key ⧼' . |
|
65 | - $messageKey . |
|
66 | - '⧽ should start with "' . |
|
67 | - self::MESSAGE_KEY_PREFIX . |
|
64 | + 'ViolationMessage key ⧼'. |
|
65 | + $messageKey. |
|
66 | + '⧽ should start with "'. |
|
67 | + self::MESSAGE_KEY_PREFIX. |
|
68 | 68 | '".' |
69 | 69 | ); |
70 | 70 | } |
71 | 71 | |
72 | - $this->messageKeySuffix = substr( $messageKey, strlen( self::MESSAGE_KEY_PREFIX ) ); |
|
72 | + $this->messageKeySuffix = substr($messageKey, strlen(self::MESSAGE_KEY_PREFIX)); |
|
73 | 73 | $this->arguments = []; |
74 | 74 | } |
75 | 75 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return string |
79 | 79 | */ |
80 | 80 | public function getMessageKey() { |
81 | - return self::MESSAGE_KEY_PREFIX . $this->messageKeySuffix; |
|
81 | + return self::MESSAGE_KEY_PREFIX.$this->messageKeySuffix; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | * @param mixed $value the value, which should match the $type |
97 | 97 | * @return ViolationMessage |
98 | 98 | */ |
99 | - private function withArgument( $type, $role, $value ) { |
|
99 | + private function withArgument($type, $role, $value) { |
|
100 | 100 | $ret = clone $this; |
101 | - $ret->arguments[] = [ 'type' => $type, 'role' => $role, 'value' => $value ]; |
|
101 | + $ret->arguments[] = ['type' => $type, 'role' => $role, 'value' => $value]; |
|
102 | 102 | return $ret; |
103 | 103 | } |
104 | 104 | |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | * @param string|null $role one of the Role::* constants |
111 | 111 | * @return ViolationMessage |
112 | 112 | */ |
113 | - public function withEntityId( EntityId $entityId, $role = null ) { |
|
114 | - return $this->withArgument( self::TYPE_ENTITY_ID, $role, $entityId ); |
|
113 | + public function withEntityId(EntityId $entityId, $role = null) { |
|
114 | + return $this->withArgument(self::TYPE_ENTITY_ID, $role, $entityId); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | * @param string|null $role one of the Role::* constants |
129 | 129 | * @return ViolationMessage |
130 | 130 | */ |
131 | - public function withEntityIdList( array $entityIdList, $role = null ) { |
|
132 | - return $this->withArgument( self::TYPE_ENTITY_ID_LIST, $role, $entityIdList ); |
|
131 | + public function withEntityIdList(array $entityIdList, $role = null) { |
|
132 | + return $this->withArgument(self::TYPE_ENTITY_ID_LIST, $role, $entityIdList); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | * @param string|null $role one of the Role::* constants |
141 | 141 | * @return ViolationMessage |
142 | 142 | */ |
143 | - public function withItemIdSnakValue( ItemIdSnakValue $value, $role = null ) { |
|
144 | - return $this->withArgument( self::TYPE_ITEM_ID_SNAK_VALUE, $role, $value ); |
|
143 | + public function withItemIdSnakValue(ItemIdSnakValue $value, $role = null) { |
|
144 | + return $this->withArgument(self::TYPE_ITEM_ID_SNAK_VALUE, $role, $value); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | } |
@@ -52,90 +52,90 @@ discard block |
||
52 | 52 | $language = null, |
53 | 53 | $format = Message::FORMAT_ESCAPED |
54 | 54 | ) { |
55 | - if ( is_string( $violationMessage ) ) { |
|
55 | + if (is_string($violationMessage)) { |
|
56 | 56 | // TODO remove this once all checkers produce ViolationMessage objects |
57 | 57 | return $violationMessage; |
58 | 58 | } |
59 | - $message = new Message( $violationMessage->getMessageKey(), [], $language ); |
|
60 | - foreach ( $violationMessage->getArguments() as $argument ) { |
|
61 | - $this->renderArgument( $argument, $message ); |
|
59 | + $message = new Message($violationMessage->getMessageKey(), [], $language); |
|
60 | + foreach ($violationMessage->getArguments() as $argument) { |
|
61 | + $this->renderArgument($argument, $message); |
|
62 | 62 | } |
63 | - return $message->toString( $format ); |
|
63 | + return $message->toString($format); |
|
64 | 64 | } |
65 | 65 | |
66 | - private function addRole( $value, $role ) { |
|
67 | - if ( $role === null ) { |
|
66 | + private function addRole($value, $role) { |
|
67 | + if ($role === null) { |
|
68 | 68 | return $value; |
69 | 69 | } |
70 | 70 | |
71 | - return '<span class="wbqc-role wbqc-role-' . htmlspecialchars( $role ) . '">' . |
|
72 | - $value . |
|
71 | + return '<span class="wbqc-role wbqc-role-'.htmlspecialchars($role).'">'. |
|
72 | + $value. |
|
73 | 73 | '</span>'; |
74 | 74 | } |
75 | 75 | |
76 | - private function renderArgument( array $argument, Message $message ) { |
|
76 | + private function renderArgument(array $argument, Message $message) { |
|
77 | 77 | $type = $argument['type']; |
78 | 78 | $value = $argument['value']; |
79 | 79 | $role = $argument['role']; |
80 | - switch ( $type ) { |
|
80 | + switch ($type) { |
|
81 | 81 | case ViolationMessage::TYPE_ENTITY_ID: |
82 | - $params = $this->renderEntityId( $value, $role ); |
|
82 | + $params = $this->renderEntityId($value, $role); |
|
83 | 83 | break; |
84 | 84 | case ViolationMessage::TYPE_ENTITY_ID_LIST: |
85 | - $params = $this->renderEntityIdList( $value, $role ); |
|
85 | + $params = $this->renderEntityIdList($value, $role); |
|
86 | 86 | break; |
87 | 87 | case ViolationMessage::TYPE_ITEM_ID_SNAK_VALUE: |
88 | - $params = $this->renderItemIdSnakValue( $value, $role ); |
|
88 | + $params = $this->renderItemIdSnakValue($value, $role); |
|
89 | 89 | break; |
90 | 90 | default: |
91 | 91 | throw new InvalidArgumentException( |
92 | - 'Unknown ViolationMessage argument type ' . $type . '!' |
|
92 | + 'Unknown ViolationMessage argument type '.$type.'!' |
|
93 | 93 | ); |
94 | 94 | } |
95 | - $message->params( $params ); |
|
95 | + $message->params($params); |
|
96 | 96 | } |
97 | 97 | |
98 | - private function renderEntityId( EntityId $entityId, $role ) { |
|
99 | - return Message::rawParam( $this->addRole( |
|
100 | - $this->entityIdFormatter->formatEntityId( $entityId ), |
|
98 | + private function renderEntityId(EntityId $entityId, $role) { |
|
99 | + return Message::rawParam($this->addRole( |
|
100 | + $this->entityIdFormatter->formatEntityId($entityId), |
|
101 | 101 | $role |
102 | - ) ); |
|
102 | + )); |
|
103 | 103 | } |
104 | 104 | |
105 | - private function renderEntityIdList( array $entityIdList, $role ) { |
|
106 | - if ( $entityIdList === [] ) { |
|
105 | + private function renderEntityIdList(array $entityIdList, $role) { |
|
106 | + if ($entityIdList === []) { |
|
107 | 107 | return [ |
108 | - Message::numParam( 0 ), |
|
109 | - Message::rawParam( '<ul></ul>' ), |
|
108 | + Message::numParam(0), |
|
109 | + Message::rawParam('<ul></ul>'), |
|
110 | 110 | ]; |
111 | 111 | } |
112 | 112 | |
113 | - if ( count( $entityIdList ) > $this->maxListLength ) { |
|
114 | - $entityIdList = array_slice( $entityIdList, 0, $this->maxListLength ); |
|
113 | + if (count($entityIdList) > $this->maxListLength) { |
|
114 | + $entityIdList = array_slice($entityIdList, 0, $this->maxListLength); |
|
115 | 115 | $truncated = true; |
116 | 116 | } |
117 | 117 | |
118 | 118 | $renderedParams = array_map( |
119 | - [ $this, 'renderEntityId' ], |
|
119 | + [$this, 'renderEntityId'], |
|
120 | 120 | $entityIdList, |
121 | - array_fill( 0, count( $entityIdList ), $role ) |
|
121 | + array_fill(0, count($entityIdList), $role) |
|
122 | 122 | ); |
123 | 123 | $renderedElements = array_map( |
124 | - function ( $param ) { |
|
124 | + function($param) { |
|
125 | 125 | return $param['raw']; |
126 | 126 | }, |
127 | 127 | $renderedParams |
128 | 128 | ); |
129 | - if ( isset( $truncated ) ) { |
|
130 | - $renderedElements[] = wfMessage( 'ellipsis' )->escaped(); |
|
129 | + if (isset($truncated)) { |
|
130 | + $renderedElements[] = wfMessage('ellipsis')->escaped(); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | return array_merge( |
134 | 134 | [ |
135 | - Message::numParam( count( $entityIdList ) ), |
|
135 | + Message::numParam(count($entityIdList)), |
|
136 | 136 | Message::rawParam( |
137 | - '<ul><li>' . |
|
138 | - implode( '</li><li>', $renderedElements ) . |
|
137 | + '<ul><li>'. |
|
138 | + implode('</li><li>', $renderedElements). |
|
139 | 139 | '</li></ul>' |
140 | 140 | ), |
141 | 141 | ], |
@@ -143,24 +143,24 @@ discard block |
||
143 | 143 | ); |
144 | 144 | } |
145 | 145 | |
146 | - private function renderItemIdSnakValue( ItemIdSnakValue $value, $role ) { |
|
147 | - switch ( true ) { |
|
146 | + private function renderItemIdSnakValue(ItemIdSnakValue $value, $role) { |
|
147 | + switch (true) { |
|
148 | 148 | case $value->isValue(): |
149 | - return $this->renderEntityId( $value->getItemId(), $role ); |
|
149 | + return $this->renderEntityId($value->getItemId(), $role); |
|
150 | 150 | case $value->isSomeValue(): |
151 | - return Message::rawParam( $this->addRole( |
|
152 | - '<span class="wikibase-snakview-variation-somevaluesnak">' . |
|
153 | - wfMessage( 'wikibase-snakview-snaktypeselector-somevalue' )->escaped() . |
|
151 | + return Message::rawParam($this->addRole( |
|
152 | + '<span class="wikibase-snakview-variation-somevaluesnak">'. |
|
153 | + wfMessage('wikibase-snakview-snaktypeselector-somevalue')->escaped(). |
|
154 | 154 | '</span>', |
155 | 155 | $role |
156 | - ) ); |
|
156 | + )); |
|
157 | 157 | case $value->isNoValue(): |
158 | - return Message::rawParam( $this->addRole( |
|
159 | - '<span class="wikibase-snakview-variation-novaluesnak">' . |
|
160 | - wfMessage( 'wikibase-snakview-snaktypeselector-novalue' )->escaped() . |
|
158 | + return Message::rawParam($this->addRole( |
|
159 | + '<span class="wikibase-snakview-variation-novaluesnak">'. |
|
160 | + wfMessage('wikibase-snakview-snaktypeselector-novalue')->escaped(). |
|
161 | 161 | '</span>', |
162 | 162 | $role |
163 | - ) ); |
|
163 | + )); |
|
164 | 164 | default: |
165 | 165 | // @codeCoverageIgnoreStart |
166 | 166 | throw new LogicException( |