@@ -10,5 +10,5 @@ |
||
10 | 10 | |
11 | 11 | /** English (English) */ |
12 | 12 | $specialPageAliases['en'] = [ |
13 | - 'ConstraintReport' => [ 'ConstraintReport', 'Constraint Report' ], |
|
13 | + 'ConstraintReport' => ['ConstraintReport', 'Constraint Report'], |
|
14 | 14 | ]; |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | private $metadata; |
22 | 22 | |
23 | - public function __construct( array $array, Metadata $metadata ) { |
|
23 | + public function __construct(array $array, Metadata $metadata) { |
|
24 | 24 | $this->array = $array; |
25 | 25 | $this->metadata = $metadata; |
26 | 26 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param bool $bool |
25 | 25 | * @param Metadata $metadata |
26 | 26 | */ |
27 | - public function __construct( $bool, Metadata $metadata ) { |
|
27 | + public function __construct($bool, Metadata $metadata) { |
|
28 | 28 | $this->bool = $bool; |
29 | 29 | $this->metadata = $metadata; |
30 | 30 | } |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | StatementList $statementList, |
31 | 31 | PropertyId $propertyId |
32 | 32 | ) { |
33 | - $statementListByPropertyId = $statementList->getByPropertyId( $propertyId ); |
|
34 | - if ( $statementListByPropertyId->isEmpty() ) { |
|
33 | + $statementListByPropertyId = $statementList->getByPropertyId($propertyId); |
|
34 | + if ($statementListByPropertyId->isEmpty()) { |
|
35 | 35 | return null; |
36 | 36 | } else { |
37 | 37 | return $statementListByPropertyId->toArray()[0]; |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | PropertyId $propertyId, |
53 | 53 | EntityId $value |
54 | 54 | ) { |
55 | - $statementListByPropertyId = $statementList->getByPropertyId( $propertyId ); |
|
55 | + $statementListByPropertyId = $statementList->getByPropertyId($propertyId); |
|
56 | 56 | /** @var Statement $statement */ |
57 | - foreach ( $statementListByPropertyId as $statement ) { |
|
57 | + foreach ($statementListByPropertyId as $statement) { |
|
58 | 58 | $snak = $statement->getMainSnak(); |
59 | - if ( $snak instanceof PropertyValueSnak ) { |
|
59 | + if ($snak instanceof PropertyValueSnak) { |
|
60 | 60 | $dataValue = $snak->getDataValue(); |
61 | - if ( $dataValue instanceof EntityIdValue && |
|
62 | - $dataValue->getEntityId()->equals( $value ) |
|
61 | + if ($dataValue instanceof EntityIdValue && |
|
62 | + $dataValue->getEntityId()->equals($value) |
|
63 | 63 | ) { |
64 | 64 | return $statement; |
65 | 65 | } |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | PropertyId $propertyId, |
83 | 83 | array $values |
84 | 84 | ) { |
85 | - $statementListByPropertyId = $statementList->getByPropertyId( $propertyId ); |
|
85 | + $statementListByPropertyId = $statementList->getByPropertyId($propertyId); |
|
86 | 86 | /** @var Statement $statement */ |
87 | - foreach ( $statementListByPropertyId as $statement ) { |
|
87 | + foreach ($statementListByPropertyId as $statement) { |
|
88 | 88 | $snak = $statement->getMainSnak(); |
89 | - foreach ( $values as $value ) { |
|
90 | - if ( $value->matchesSnak( $snak ) ) { |
|
89 | + foreach ($values as $value) { |
|
90 | + if ($value->matchesSnak($snak)) { |
|
91 | 91 | return $statement; |
92 | 92 | } |
93 | 93 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * @param bool $serializeConstraintParameters Whether to serialize constraint parameters or not. |
18 | 18 | */ |
19 | - public function __construct( $serializeConstraintParameters = true ) { |
|
19 | + public function __construct($serializeConstraintParameters = true) { |
|
20 | 20 | $this->serializeConstraintParameters = $serializeConstraintParameters; |
21 | 21 | } |
22 | 22 | |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | * @param Constraint $constraint |
25 | 25 | * @return array |
26 | 26 | */ |
27 | - public function serialize( Constraint $constraint ) { |
|
27 | + public function serialize(Constraint $constraint) { |
|
28 | 28 | $serialization = [ |
29 | 29 | 'id' => $constraint->getConstraintId(), |
30 | 30 | 'pid' => $constraint->getPropertyId()->getSerialization(), |
31 | 31 | 'qid' => $constraint->getConstraintTypeItemId(), |
32 | 32 | ]; |
33 | - if ( $this->serializeConstraintParameters ) { |
|
33 | + if ($this->serializeConstraintParameters) { |
|
34 | 34 | $serialization['params'] = $constraint->getConstraintParameters(); |
35 | 35 | } |
36 | 36 | return $serialization; |
@@ -21,9 +21,9 @@ |
||
21 | 21 | /** |
22 | 22 | * @param ViolationMessage $violationMessage |
23 | 23 | */ |
24 | - public function __construct( ViolationMessage $violationMessage ) { |
|
25 | - $message = '⧼' . $violationMessage->getMessageKey() . '⧽'; |
|
26 | - parent::__construct( $message ); |
|
24 | + public function __construct(ViolationMessage $violationMessage) { |
|
25 | + $message = '⧼'.$violationMessage->getMessageKey().'⧽'; |
|
26 | + parent::__construct($message); |
|
27 | 27 | |
28 | 28 | $this->violationMessage = $violationMessage; |
29 | 29 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | class TooManySparqlRequestsException extends SparqlHelperException { |
9 | 9 | |
10 | 10 | public function __construct() { |
11 | - parent::__construct( 'The SPARQL query endpoint reports too many requests.' ); |
|
11 | + parent::__construct('The SPARQL query endpoint reports too many requests.'); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | } |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | * @param ContextCursor $cursor |
14 | 14 | * @return array |
15 | 15 | */ |
16 | - public function serialize( ContextCursor $cursor ) { |
|
17 | - if ( $cursor instanceof EntityContextCursor ) { |
|
16 | + public function serialize(ContextCursor $cursor) { |
|
17 | + if ($cursor instanceof EntityContextCursor) { |
|
18 | 18 | return [ |
19 | 19 | 't' => '\entity', |
20 | 20 | 'i' => $cursor->getEntityId(), |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | 'h' => $cursor->getSnakHash(), |
31 | 31 | ]; |
32 | 32 | |
33 | - if ( $type === Context::TYPE_QUALIFIER || $type === Context::TYPE_REFERENCE ) { |
|
33 | + if ($type === Context::TYPE_QUALIFIER || $type === Context::TYPE_REFERENCE) { |
|
34 | 34 | $serialization['P'] = $cursor->getSnakPropertyId(); |
35 | - if ( $type === Context::TYPE_REFERENCE ) { |
|
35 | + if ($type === Context::TYPE_REFERENCE) { |
|
36 | 36 | /** @var ReferenceContextCursor $cursor */ |
37 | 37 | '@phan-var ReferenceContextCursor $cursor'; |
38 | 38 | $serialization['r'] = $cursor->getReferenceHash(); |
@@ -65,6 +65,6 @@ |
||
65 | 65 | * @param ?array $result |
66 | 66 | * @param array[] &$container |
67 | 67 | */ |
68 | - public function storeCheckResultInArray( ?array $result, array &$container ); |
|
68 | + public function storeCheckResultInArray(?array $result, array &$container); |
|
69 | 69 | |
70 | 70 | } |