@@ -20,13 +20,13 @@ |
||
20 | 20 | * @param PropertyId $propertyId |
21 | 21 | * @return int |
22 | 22 | */ |
23 | - public function getPropertyCount( array $snaks, PropertyId $propertyId ) { |
|
24 | - return count( array_filter( |
|
23 | + public function getPropertyCount(array $snaks, PropertyId $propertyId) { |
|
24 | + return count(array_filter( |
|
25 | 25 | $snaks, |
26 | - function ( Snak $snak ) use ( $propertyId ) { |
|
27 | - return $snak->getPropertyId()->equals( $propertyId ); |
|
26 | + function(Snak $snak) use ($propertyId) { |
|
27 | + return $snak->getPropertyId()->equals($propertyId); |
|
28 | 28 | } |
29 | - ) ); |
|
29 | + )); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | } |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return CheckResult |
56 | 56 | */ |
57 | - public function checkConstraint( Context $context, Constraint $constraint ) { |
|
58 | - if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) { |
|
59 | - return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED ); |
|
57 | + public function checkConstraint(Context $context, Constraint $constraint) { |
|
58 | + if ($context->getSnakRank() === Statement::RANK_DEPRECATED) { |
|
59 | + return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $propertyId = $context->getSnak()->getPropertyId(); |
@@ -68,18 +68,18 @@ discard block |
||
68 | 68 | $propertyId |
69 | 69 | ); |
70 | 70 | |
71 | - if ( $propertyCount <= 1 ) { |
|
72 | - $message = wfMessage( "wbqc-violation-message-multi-value" )->escaped(); |
|
71 | + if ($propertyCount <= 1) { |
|
72 | + $message = wfMessage("wbqc-violation-message-multi-value")->escaped(); |
|
73 | 73 | $status = CheckResult::STATUS_VIOLATION; |
74 | 74 | } else { |
75 | 75 | $message = ''; |
76 | 76 | $status = CheckResult::STATUS_COMPLIANCE; |
77 | 77 | } |
78 | 78 | |
79 | - return new CheckResult( $context, $constraint, $parameters, $status, $message ); |
|
79 | + return new CheckResult($context, $constraint, $parameters, $status, $message); |
|
80 | 80 | } |
81 | 81 | |
82 | - public function checkConstraintParameters( Constraint $constraint ) { |
|
82 | + public function checkConstraintParameters(Constraint $constraint) { |
|
83 | 83 | // no parameters |
84 | 84 | return []; |
85 | 85 | } |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return CheckResult |
56 | 56 | */ |
57 | - public function checkConstraint( Context $context, Constraint $constraint ) { |
|
58 | - if ( $context->getSnakRank() === Statement::RANK_DEPRECATED ) { |
|
59 | - return new CheckResult( $context, $constraint, [], CheckResult::STATUS_DEPRECATED ); |
|
57 | + public function checkConstraint(Context $context, Constraint $constraint) { |
|
58 | + if ($context->getSnakRank() === Statement::RANK_DEPRECATED) { |
|
59 | + return new CheckResult($context, $constraint, [], CheckResult::STATUS_DEPRECATED); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $propertyId = $context->getSnak()->getPropertyId(); |
@@ -68,18 +68,18 @@ discard block |
||
68 | 68 | $propertyId |
69 | 69 | ); |
70 | 70 | |
71 | - if ( $propertyCount > 1 ) { |
|
72 | - $message = wfMessage( "wbqc-violation-message-single-value" )->escaped(); |
|
71 | + if ($propertyCount > 1) { |
|
72 | + $message = wfMessage("wbqc-violation-message-single-value")->escaped(); |
|
73 | 73 | $status = CheckResult::STATUS_VIOLATION; |
74 | 74 | } else { |
75 | 75 | $message = ''; |
76 | 76 | $status = CheckResult::STATUS_COMPLIANCE; |
77 | 77 | } |
78 | 78 | |
79 | - return new CheckResult( $context, $constraint, $parameters, $status, $message ); |
|
79 | + return new CheckResult($context, $constraint, $parameters, $status, $message); |
|
80 | 80 | } |
81 | 81 | |
82 | - public function checkConstraintParameters( Constraint $constraint ) { |
|
82 | + public function checkConstraintParameters(Constraint $constraint) { |
|
83 | 83 | // no parameters |
84 | 84 | return []; |
85 | 85 | } |