@@ -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,10 +33,10 @@ 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 | - protected function &getMainArray( array &$container ) { |
|
39 | + protected function &getMainArray(array &$container) { |
|
40 | 40 | $statementArray = &$this->getStatementArray( |
41 | 41 | $container, |
42 | 42 | $this->entity->getId()->getSerialization(), |
@@ -44,25 +44,25 @@ discard block |
||
44 | 44 | $this->statement->getGuid() |
45 | 45 | ); |
46 | 46 | |
47 | - if ( !array_key_exists( 'qualifiers', $statementArray ) ) { |
|
47 | + if (!array_key_exists('qualifiers', $statementArray)) { |
|
48 | 48 | $statementArray['qualifiers'] = []; |
49 | 49 | } |
50 | 50 | $qualifiersArray = &$statementArray['qualifiers']; |
51 | 51 | |
52 | 52 | $propertyId = $this->getSnak()->getPropertyId()->getSerialization(); |
53 | - if ( !array_key_exists( $propertyId, $qualifiersArray ) ) { |
|
53 | + if (!array_key_exists($propertyId, $qualifiersArray)) { |
|
54 | 54 | $qualifiersArray[$propertyId] = []; |
55 | 55 | } |
56 | 56 | $propertyArray = &$qualifiersArray[$propertyId]; |
57 | 57 | |
58 | - foreach ( $propertyArray as &$potentialQualifierArray ) { |
|
59 | - if ( $potentialQualifierArray['hash'] === $this->getSnak()->getHash() ) { |
|
58 | + foreach ($propertyArray as &$potentialQualifierArray) { |
|
59 | + if ($potentialQualifierArray['hash'] === $this->getSnak()->getHash()) { |
|
60 | 60 | $qualifierArray = &$potentialQualifierArray; |
61 | 61 | break; |
62 | 62 | } |
63 | 63 | } |
64 | - if ( !isset( $qualifierArray ) ) { |
|
65 | - $qualifierArray = [ 'hash' => $this->getSnak()->getHash() ]; |
|
64 | + if (!isset($qualifierArray)) { |
|
65 | + $qualifierArray = ['hash' => $this->getSnak()->getHash()]; |
|
66 | 66 | $propertyArray[] = &$qualifierArray; |
67 | 67 | } |
68 | 68 |
@@ -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,10 +41,10 @@ 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 | - protected function &getMainArray( array &$container ) { |
|
47 | + protected function &getMainArray(array &$container) { |
|
48 | 48 | $statementArray = &$this->getStatementArray( |
49 | 49 | $container, |
50 | 50 | $this->entity->getId()->getSerialization(), |
@@ -52,38 +52,38 @@ discard block |
||
52 | 52 | $this->statement->getGuid() |
53 | 53 | ); |
54 | 54 | |
55 | - if ( !array_key_exists( 'references', $statementArray ) ) { |
|
55 | + if (!array_key_exists('references', $statementArray)) { |
|
56 | 56 | $statementArray['references'] = []; |
57 | 57 | } |
58 | 58 | $referencesArray = &$statementArray['references']; |
59 | 59 | |
60 | - foreach ( $referencesArray as &$potentialReferenceArray ) { |
|
61 | - if ( $potentialReferenceArray['hash'] === $this->reference->getHash() ) { |
|
60 | + foreach ($referencesArray as &$potentialReferenceArray) { |
|
61 | + if ($potentialReferenceArray['hash'] === $this->reference->getHash()) { |
|
62 | 62 | $referenceArray = &$potentialReferenceArray; |
63 | 63 | break; |
64 | 64 | } |
65 | 65 | } |
66 | - if ( !isset( $referenceArray ) ) { |
|
67 | - $referenceArray = [ 'hash' => $this->reference->getHash(), 'snaks' => [] ]; |
|
66 | + if (!isset($referenceArray)) { |
|
67 | + $referenceArray = ['hash' => $this->reference->getHash(), 'snaks' => []]; |
|
68 | 68 | $referencesArray[] = &$referenceArray; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $snaksArray = &$referenceArray['snaks']; |
72 | 72 | |
73 | 73 | $propertyId = $this->getSnak()->getPropertyId()->getSerialization(); |
74 | - if ( !array_key_exists( $propertyId, $snaksArray ) ) { |
|
74 | + if (!array_key_exists($propertyId, $snaksArray)) { |
|
75 | 75 | $snaksArray[$propertyId] = []; |
76 | 76 | } |
77 | 77 | $propertyArray = &$snaksArray[$propertyId]; |
78 | 78 | |
79 | - foreach ( $propertyArray as &$potentialSnakArray ) { |
|
80 | - if ( $potentialSnakArray['hash'] === $this->getSnak()->getHash() ) { |
|
79 | + foreach ($propertyArray as &$potentialSnakArray) { |
|
80 | + if ($potentialSnakArray['hash'] === $this->getSnak()->getHash()) { |
|
81 | 81 | $snakArray = &$potentialSnakArray; |
82 | 82 | break; |
83 | 83 | } |
84 | 84 | } |
85 | - if ( !isset( $snakArray ) ) { |
|
86 | - $snakArray = [ 'hash' => $this->getSnak()->getHash() ]; |
|
85 | + if (!isset($snakArray)) { |
|
86 | + $snakArray = ['hash' => $this->getSnak()->getHash()]; |
|
87 | 87 | $propertyArray[] = &$snakArray; |
88 | 88 | } |
89 | 89 |
@@ -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,11 +43,11 @@ 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 | |
50 | - protected function &getMainArray( array &$container ) { |
|
50 | + protected function &getMainArray(array &$container) { |
|
51 | 51 | $statementArray = &$this->getStatementArray( |
52 | 52 | $container, |
53 | 53 | $this->entity->getId()->getSerialization(), |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | $this->statement->getGuid() |
56 | 56 | ); |
57 | 57 | |
58 | - if ( !array_key_exists( 'mainsnak', $statementArray ) ) { |
|
59 | - $statementArray['mainsnak'] = [ 'hash' => $this->statement->getMainSnak()->getHash() ]; |
|
58 | + if (!array_key_exists('mainsnak', $statementArray)) { |
|
59 | + $statementArray['mainsnak'] = ['hash' => $this->statement->getMainSnak()->getHash()]; |
|
60 | 60 | } |
61 | 61 | $mainsnakArray = &$statementArray['mainsnak']; |
62 | 62 |