@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $this->snakHash = $snakHash; |
46 | 46 | } |
47 | 47 | |
48 | - protected function &getMainArray( array &$container ) { |
|
48 | + protected function &getMainArray(array &$container) { |
|
49 | 49 | $statementArray = &$this->getStatementArray( |
50 | 50 | $container, |
51 | 51 | $this->entityId, |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | $this->statementGuid |
54 | 54 | ); |
55 | 55 | |
56 | - if ( !array_key_exists( 'mainsnak', $statementArray ) ) { |
|
57 | - $statementArray['mainsnak'] = [ 'hash' => $this->snakHash ]; |
|
56 | + if (!array_key_exists('mainsnak', $statementArray)) { |
|
57 | + $statementArray['mainsnak'] = ['hash' => $this->snakHash]; |
|
58 | 58 | } |
59 | 59 | $mainsnakArray = &$statementArray['mainsnak']; |
60 | 60 |
@@ -86,6 +86,6 @@ |
||
86 | 86 | * @param array|null $result |
87 | 87 | * @param array[] &$container |
88 | 88 | */ |
89 | - public function storeCheckResultInArray( array $result = null, array &$container ); |
|
89 | + public function storeCheckResultInArray(array $result = null, array &$container); |
|
90 | 90 | |
91 | 91 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->referenceHash = $referenceHash; |
62 | 62 | } |
63 | 63 | |
64 | - protected function &getMainArray( array &$container ) { |
|
64 | + protected function &getMainArray(array &$container) { |
|
65 | 65 | $statementArray = &$this->getStatementArray( |
66 | 66 | $container, |
67 | 67 | $this->entityId, |
@@ -69,37 +69,37 @@ discard block |
||
69 | 69 | $this->statementGuid |
70 | 70 | ); |
71 | 71 | |
72 | - if ( !array_key_exists( 'references', $statementArray ) ) { |
|
72 | + if (!array_key_exists('references', $statementArray)) { |
|
73 | 73 | $statementArray['references'] = []; |
74 | 74 | } |
75 | 75 | $referencesArray = &$statementArray['references']; |
76 | 76 | |
77 | - foreach ( $referencesArray as &$potentialReferenceArray ) { |
|
78 | - if ( $potentialReferenceArray['hash'] === $this->referenceHash ) { |
|
77 | + foreach ($referencesArray as &$potentialReferenceArray) { |
|
78 | + if ($potentialReferenceArray['hash'] === $this->referenceHash) { |
|
79 | 79 | $referenceArray = &$potentialReferenceArray; |
80 | 80 | break; |
81 | 81 | } |
82 | 82 | } |
83 | - if ( !isset( $referenceArray ) ) { |
|
84 | - $referenceArray = [ 'hash' => $this->referenceHash, 'snaks' => [] ]; |
|
83 | + if (!isset($referenceArray)) { |
|
84 | + $referenceArray = ['hash' => $this->referenceHash, 'snaks' => []]; |
|
85 | 85 | $referencesArray[] = &$referenceArray; |
86 | 86 | } |
87 | 87 | |
88 | 88 | $snaksArray = &$referenceArray['snaks']; |
89 | 89 | |
90 | - if ( !array_key_exists( $this->snakPropertyId, $snaksArray ) ) { |
|
90 | + if (!array_key_exists($this->snakPropertyId, $snaksArray)) { |
|
91 | 91 | $snaksArray[$this->snakPropertyId] = []; |
92 | 92 | } |
93 | 93 | $propertyArray = &$snaksArray[$this->snakPropertyId]; |
94 | 94 | |
95 | - foreach ( $propertyArray as &$potentialSnakArray ) { |
|
96 | - if ( $potentialSnakArray['hash'] === $this->snakHash ) { |
|
95 | + foreach ($propertyArray as &$potentialSnakArray) { |
|
96 | + if ($potentialSnakArray['hash'] === $this->snakHash) { |
|
97 | 97 | $snakArray = &$potentialSnakArray; |
98 | 98 | break; |
99 | 99 | } |
100 | 100 | } |
101 | - if ( !isset( $snakArray ) ) { |
|
102 | - $snakArray = [ 'hash' => $this->snakHash ]; |
|
101 | + if (!isset($snakArray)) { |
|
102 | + $snakArray = ['hash' => $this->snakHash]; |
|
103 | 103 | $propertyArray[] = &$snakArray; |
104 | 104 | } |
105 | 105 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | Reference $reference, |
31 | 31 | Snak $snak |
32 | 32 | ) { |
33 | - parent::__construct( $entity, $snak ); |
|
33 | + parent::__construct($entity, $snak); |
|
34 | 34 | $this->statement = $statement; |
35 | 35 | $this->reference = $reference; |
36 | 36 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | public function getSnakGroup() { |
43 | 43 | $snaks = $this->reference->getSnaks(); |
44 | - return array_values( $snaks->getArrayCopy() ); |
|
44 | + return array_values($snaks->getArrayCopy()); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function getCursor() { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | ); |
56 | 56 | } |
57 | 57 | |
58 | - protected function &getMainArray( array &$container ) { |
|
58 | + protected function &getMainArray(array &$container) { |
|
59 | 59 | $statementArray = &$this->getStatementArray( |
60 | 60 | $container, |
61 | 61 | $this->entity->getId()->getSerialization(), |
@@ -63,38 +63,38 @@ discard block |
||
63 | 63 | $this->statement->getGuid() |
64 | 64 | ); |
65 | 65 | |
66 | - if ( !array_key_exists( 'references', $statementArray ) ) { |
|
66 | + if (!array_key_exists('references', $statementArray)) { |
|
67 | 67 | $statementArray['references'] = []; |
68 | 68 | } |
69 | 69 | $referencesArray = &$statementArray['references']; |
70 | 70 | |
71 | - foreach ( $referencesArray as &$potentialReferenceArray ) { |
|
72 | - if ( $potentialReferenceArray['hash'] === $this->reference->getHash() ) { |
|
71 | + foreach ($referencesArray as &$potentialReferenceArray) { |
|
72 | + if ($potentialReferenceArray['hash'] === $this->reference->getHash()) { |
|
73 | 73 | $referenceArray = &$potentialReferenceArray; |
74 | 74 | break; |
75 | 75 | } |
76 | 76 | } |
77 | - if ( !isset( $referenceArray ) ) { |
|
78 | - $referenceArray = [ 'hash' => $this->reference->getHash(), 'snaks' => [] ]; |
|
77 | + if (!isset($referenceArray)) { |
|
78 | + $referenceArray = ['hash' => $this->reference->getHash(), 'snaks' => []]; |
|
79 | 79 | $referencesArray[] = &$referenceArray; |
80 | 80 | } |
81 | 81 | |
82 | 82 | $snaksArray = &$referenceArray['snaks']; |
83 | 83 | |
84 | 84 | $propertyId = $this->getSnak()->getPropertyId()->getSerialization(); |
85 | - if ( !array_key_exists( $propertyId, $snaksArray ) ) { |
|
85 | + if (!array_key_exists($propertyId, $snaksArray)) { |
|
86 | 86 | $snaksArray[$propertyId] = []; |
87 | 87 | } |
88 | 88 | $propertyArray = &$snaksArray[$propertyId]; |
89 | 89 | |
90 | - foreach ( $propertyArray as &$potentialSnakArray ) { |
|
91 | - if ( $potentialSnakArray['hash'] === $this->getSnak()->getHash() ) { |
|
90 | + foreach ($propertyArray as &$potentialSnakArray) { |
|
91 | + if ($potentialSnakArray['hash'] === $this->getSnak()->getHash()) { |
|
92 | 92 | $snakArray = &$potentialSnakArray; |
93 | 93 | break; |
94 | 94 | } |
95 | 95 | } |
96 | - if ( !isset( $snakArray ) ) { |
|
97 | - $snakArray = [ 'hash' => $this->getSnak()->getHash() ]; |
|
96 | + if (!isset($snakArray)) { |
|
97 | + $snakArray = ['hash' => $this->getSnak()->getHash()]; |
|
98 | 98 | $propertyArray[] = &$snakArray; |
99 | 99 | } |
100 | 100 |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | */ |
21 | 21 | private $statement; |
22 | 22 | |
23 | - public function __construct( EntityDocument $entity, Statement $statement ) { |
|
24 | - Assert::parameterType( StatementListProvider::class, $entity, '$entity' ); |
|
25 | - parent::__construct( $entity, $statement->getMainSnak() ); |
|
23 | + public function __construct(EntityDocument $entity, Statement $statement) { |
|
24 | + Assert::parameterType(StatementListProvider::class, $entity, '$entity'); |
|
25 | + parent::__construct($entity, $statement->getMainSnak()); |
|
26 | 26 | |
27 | 27 | $this->statement = $statement; |
28 | 28 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | /** @var StatementList $statements */ |
44 | 44 | $statements = $this->entity->getStatements(); |
45 | 45 | return $statements |
46 | - ->getByRank( [ Statement::RANK_NORMAL, Statement::RANK_PREFERRED ] ) |
|
46 | + ->getByRank([Statement::RANK_NORMAL, Statement::RANK_PREFERRED]) |
|
47 | 47 | ->getMainSnaks(); |
48 | 48 | } |
49 | 49 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | ); |
57 | 57 | } |
58 | 58 | |
59 | - protected function &getMainArray( array &$container ) { |
|
59 | + protected function &getMainArray(array &$container) { |
|
60 | 60 | $statementArray = &$this->getStatementArray( |
61 | 61 | $container, |
62 | 62 | $this->entity->getId()->getSerialization(), |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | $this->statement->getGuid() |
65 | 65 | ); |
66 | 66 | |
67 | - if ( !array_key_exists( 'mainsnak', $statementArray ) ) { |
|
68 | - $statementArray['mainsnak'] = [ 'hash' => $this->statement->getMainSnak()->getHash() ]; |
|
67 | + if (!array_key_exists('mainsnak', $statementArray)) { |
|
68 | + $statementArray['mainsnak'] = ['hash' => $this->statement->getMainSnak()->getHash()]; |
|
69 | 69 | } |
70 | 70 | $mainsnakArray = &$statementArray['mainsnak']; |
71 | 71 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | Statement $statement, |
24 | 24 | Snak $snak |
25 | 25 | ) { |
26 | - parent::__construct( $entity, $snak ); |
|
26 | + parent::__construct($entity, $snak); |
|
27 | 27 | $this->statement = $statement; |
28 | 28 | } |
29 | 29 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | public function getSnakGroup() { |
35 | 35 | $snaks = $this->statement->getQualifiers(); |
36 | - return array_values( $snaks->getArrayCopy() ); |
|
36 | + return array_values($snaks->getArrayCopy()); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function getCursor() { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ); |
47 | 47 | } |
48 | 48 | |
49 | - protected function &getMainArray( array &$container ) { |
|
49 | + protected function &getMainArray(array &$container) { |
|
50 | 50 | $statementArray = &$this->getStatementArray( |
51 | 51 | $container, |
52 | 52 | $this->entity->getId()->getSerialization(), |
@@ -54,25 +54,25 @@ discard block |
||
54 | 54 | $this->statement->getGuid() |
55 | 55 | ); |
56 | 56 | |
57 | - if ( !array_key_exists( 'qualifiers', $statementArray ) ) { |
|
57 | + if (!array_key_exists('qualifiers', $statementArray)) { |
|
58 | 58 | $statementArray['qualifiers'] = []; |
59 | 59 | } |
60 | 60 | $qualifiersArray = &$statementArray['qualifiers']; |
61 | 61 | |
62 | 62 | $propertyId = $this->getSnak()->getPropertyId()->getSerialization(); |
63 | - if ( !array_key_exists( $propertyId, $qualifiersArray ) ) { |
|
63 | + if (!array_key_exists($propertyId, $qualifiersArray)) { |
|
64 | 64 | $qualifiersArray[$propertyId] = []; |
65 | 65 | } |
66 | 66 | $propertyArray = &$qualifiersArray[$propertyId]; |
67 | 67 | |
68 | - foreach ( $propertyArray as &$potentialQualifierArray ) { |
|
69 | - if ( $potentialQualifierArray['hash'] === $this->getSnak()->getHash() ) { |
|
68 | + foreach ($propertyArray as &$potentialQualifierArray) { |
|
69 | + if ($potentialQualifierArray['hash'] === $this->getSnak()->getHash()) { |
|
70 | 70 | $qualifierArray = &$potentialQualifierArray; |
71 | 71 | break; |
72 | 72 | } |
73 | 73 | } |
74 | - if ( !isset( $qualifierArray ) ) { |
|
75 | - $qualifierArray = [ 'hash' => $this->getSnak()->getHash() ]; |
|
74 | + if (!isset($qualifierArray)) { |
|
75 | + $qualifierArray = ['hash' => $this->getSnak()->getHash()]; |
|
76 | 76 | $propertyArray[] = &$qualifierArray; |
77 | 77 | } |
78 | 78 |