@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Context; |
| 6 | 6 | |
@@ -61,6 +61,6 @@ discard block |
||
| 61 | 61 | * @param ?array $result |
| 62 | 62 | * @param array[] &$container |
| 63 | 63 | */ |
| 64 | - public function storeCheckResultInArray( ?array $result, array &$container ): void; |
|
| 64 | + public function storeCheckResultInArray(?array $result, array &$container): void; |
|
| 65 | 65 | |
| 66 | 66 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Context; |
| 6 | 6 | |
@@ -60,29 +60,29 @@ discard block |
||
| 60 | 60 | return $this->snakHash; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - protected function &getMainArray( array &$container ): array { |
|
| 64 | - $statementArray = &$this->getStatementArray( $container ); |
|
| 63 | + protected function &getMainArray(array &$container): array { |
|
| 64 | + $statementArray = &$this->getStatementArray($container); |
|
| 65 | 65 | |
| 66 | - if ( !array_key_exists( 'qualifiers', $statementArray ) ) { |
|
| 66 | + if (!array_key_exists('qualifiers', $statementArray)) { |
|
| 67 | 67 | $statementArray['qualifiers'] = []; |
| 68 | 68 | } |
| 69 | 69 | $qualifiersArray = &$statementArray['qualifiers']; |
| 70 | 70 | |
| 71 | 71 | $snakPropertyId = $this->getSnakPropertyId(); |
| 72 | - if ( !array_key_exists( $snakPropertyId, $qualifiersArray ) ) { |
|
| 72 | + if (!array_key_exists($snakPropertyId, $qualifiersArray)) { |
|
| 73 | 73 | $qualifiersArray[$snakPropertyId] = []; |
| 74 | 74 | } |
| 75 | 75 | $propertyArray = &$qualifiersArray[$snakPropertyId]; |
| 76 | 76 | |
| 77 | 77 | $snakHash = $this->getSnakHash(); |
| 78 | - foreach ( $propertyArray as &$potentialQualifierArray ) { |
|
| 79 | - if ( $potentialQualifierArray['hash'] === $snakHash ) { |
|
| 78 | + foreach ($propertyArray as &$potentialQualifierArray) { |
|
| 79 | + if ($potentialQualifierArray['hash'] === $snakHash) { |
|
| 80 | 80 | $qualifierArray = &$potentialQualifierArray; |
| 81 | 81 | break; |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - if ( !isset( $qualifierArray ) ) { |
|
| 85 | - $qualifierArray = [ 'hash' => $snakHash ]; |
|
| 84 | + if (!isset($qualifierArray)) { |
|
| 85 | + $qualifierArray = ['hash' => $snakHash]; |
|
| 86 | 86 | $propertyArray[] = &$qualifierArray; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Context; |
| 6 | 6 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @codeCoverageIgnore This method is not supported. |
| 33 | 33 | */ |
| 34 | 34 | public function getType(): string { |
| 35 | - throw new LogicException( 'EntityContextCursor has no full associated context' ); |
|
| 35 | + throw new LogicException('EntityContextCursor has no full associated context'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function getEntityId(): string { |
@@ -43,35 +43,35 @@ discard block |
||
| 43 | 43 | * @codeCoverageIgnore This method is not supported. |
| 44 | 44 | */ |
| 45 | 45 | public function getStatementPropertyId(): string { |
| 46 | - throw new LogicException( 'EntityContextCursor has no full associated context' ); |
|
| 46 | + throw new LogicException('EntityContextCursor has no full associated context'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * @codeCoverageIgnore This method is not supported. |
| 51 | 51 | */ |
| 52 | 52 | public function getStatementGuid(): string { |
| 53 | - throw new LogicException( 'EntityContextCursor has no full associated context' ); |
|
| 53 | + throw new LogicException('EntityContextCursor has no full associated context'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * @codeCoverageIgnore This method is not supported. |
| 58 | 58 | */ |
| 59 | 59 | public function getSnakPropertyId(): string { |
| 60 | - throw new LogicException( 'EntityContextCursor has no full associated context' ); |
|
| 60 | + throw new LogicException('EntityContextCursor has no full associated context'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * @codeCoverageIgnore This method is not supported. |
| 65 | 65 | */ |
| 66 | 66 | public function getSnakHash(): string { |
| 67 | - throw new LogicException( 'EntityContextCursor has no full associated context' ); |
|
| 67 | + throw new LogicException('EntityContextCursor has no full associated context'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * @codeCoverageIgnore This method is not supported. |
| 72 | 72 | */ |
| 73 | - public function &getMainArray( array &$container ): array { |
|
| 74 | - throw new LogicException( 'EntityContextCursor cannot store check results' ); |
|
| 73 | + public function &getMainArray(array &$container): array { |
|
| 74 | + throw new LogicException('EntityContextCursor cannot store check results'); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -80,14 +80,14 @@ discard block |
||
| 80 | 80 | * @param ?array $result must be null |
| 81 | 81 | * @param array[] &$container |
| 82 | 82 | */ |
| 83 | - public function storeCheckResultInArray( ?array $result, array &$container ): void { |
|
| 84 | - if ( $result !== null ) { |
|
| 85 | - throw new LogicException( 'EntityContextCursor cannot store check results' ); |
|
| 83 | + public function storeCheckResultInArray(?array $result, array &$container): void { |
|
| 84 | + if ($result !== null) { |
|
| 85 | + throw new LogicException('EntityContextCursor cannot store check results'); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // this ensures that the claims array is present in the $container, |
| 89 | 89 | // populating it if necessary, even though we ignore the return value |
| 90 | - $this->getClaimsArray( $container ); |
|
| 90 | + $this->getClaimsArray($container); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Context; |
| 6 | 6 | |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | * @param array[] &$container |
| 30 | 30 | * @return array |
| 31 | 31 | */ |
| 32 | - protected function &getClaimsArray( array &$container ): array { |
|
| 32 | + protected function &getClaimsArray(array &$container): array { |
|
| 33 | 33 | $entityId = $this->getEntityId(); |
| 34 | 34 | |
| 35 | - if ( !array_key_exists( $entityId, $container ) ) { |
|
| 35 | + if (!array_key_exists($entityId, $container)) { |
|
| 36 | 36 | $container[$entityId] = []; |
| 37 | 37 | } |
| 38 | 38 | $entityContainer = &$container[$entityId]; |
| 39 | 39 | |
| 40 | - if ( !array_key_exists( 'claims', $entityContainer ) ) { |
|
| 40 | + if (!array_key_exists('claims', $entityContainer)) { |
|
| 41 | 41 | $entityContainer['claims'] = []; |
| 42 | 42 | } |
| 43 | 43 | $claimsArray = &$entityContainer['claims']; |
@@ -51,25 +51,25 @@ discard block |
||
| 51 | 51 | * @param array[] &$container |
| 52 | 52 | * @return array |
| 53 | 53 | */ |
| 54 | - protected function &getStatementArray( array &$container ): array { |
|
| 54 | + protected function &getStatementArray(array &$container): array { |
|
| 55 | 55 | $statementPropertyId = $this->getStatementPropertyId(); |
| 56 | 56 | $statementGuid = $this->getStatementGuid(); |
| 57 | 57 | |
| 58 | - $claimsContainer = &$this->getClaimsArray( $container ); |
|
| 58 | + $claimsContainer = &$this->getClaimsArray($container); |
|
| 59 | 59 | |
| 60 | - if ( !array_key_exists( $statementPropertyId, $claimsContainer ) ) { |
|
| 60 | + if (!array_key_exists($statementPropertyId, $claimsContainer)) { |
|
| 61 | 61 | $claimsContainer[$statementPropertyId] = []; |
| 62 | 62 | } |
| 63 | 63 | $propertyContainer = &$claimsContainer[$statementPropertyId]; |
| 64 | 64 | |
| 65 | - foreach ( $propertyContainer as &$statement ) { |
|
| 66 | - if ( $statement['id'] === $statementGuid ) { |
|
| 65 | + foreach ($propertyContainer as &$statement) { |
|
| 66 | + if ($statement['id'] === $statementGuid) { |
|
| 67 | 67 | $statementArray = &$statement; |
| 68 | 68 | break; |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | - if ( !isset( $statementArray ) ) { |
|
| 72 | - $statementArray = [ 'id' => $statementGuid ]; |
|
| 71 | + if (!isset($statementArray)) { |
|
| 72 | + $statementArray = ['id' => $statementGuid]; |
|
| 73 | 73 | $propertyContainer[] = &$statementArray; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -84,19 +84,19 @@ discard block |
||
| 84 | 84 | * @param array[] &$container |
| 85 | 85 | * @return array |
| 86 | 86 | */ |
| 87 | - abstract protected function &getMainArray( array &$container ): array; |
|
| 87 | + abstract protected function &getMainArray(array &$container): array; |
|
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * @param ?array $result |
| 91 | 91 | * @param array[] &$container |
| 92 | 92 | */ |
| 93 | - public function storeCheckResultInArray( ?array $result, array &$container ): void { |
|
| 94 | - $mainArray = &$this->getMainArray( $container ); |
|
| 95 | - if ( !array_key_exists( 'results', $mainArray ) ) { |
|
| 93 | + public function storeCheckResultInArray(?array $result, array &$container): void { |
|
| 94 | + $mainArray = &$this->getMainArray($container); |
|
| 95 | + if (!array_key_exists('results', $mainArray)) { |
|
| 96 | 96 | $mainArray['results'] = []; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if ( $result !== null ) { |
|
| 99 | + if ($result !== null) { |
|
| 100 | 100 | $mainArray['results'][] = $result; |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Context; |
| 6 | 6 | |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | return $this->snakHash; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - protected function &getMainArray( array &$container ): array { |
|
| 60 | - $statementArray = &$this->getStatementArray( $container ); |
|
| 59 | + protected function &getMainArray(array &$container): array { |
|
| 60 | + $statementArray = &$this->getStatementArray($container); |
|
| 61 | 61 | |
| 62 | - if ( !array_key_exists( 'mainsnak', $statementArray ) ) { |
|
| 62 | + if (!array_key_exists('mainsnak', $statementArray)) { |
|
| 63 | 63 | $snakHash = $this->getSnakHash(); |
| 64 | - $statementArray['mainsnak'] = [ 'hash' => $snakHash ]; |
|
| 64 | + $statementArray['mainsnak'] = ['hash' => $snakHash]; |
|
| 65 | 65 | } |
| 66 | 66 | $mainsnakArray = &$statementArray['mainsnak']; |
| 67 | 67 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Context; |
| 6 | 6 | |
@@ -68,43 +68,43 @@ discard block |
||
| 68 | 68 | return $this->referenceHash; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - protected function &getMainArray( array &$container ): array { |
|
| 72 | - $statementArray = &$this->getStatementArray( $container ); |
|
| 71 | + protected function &getMainArray(array &$container): array { |
|
| 72 | + $statementArray = &$this->getStatementArray($container); |
|
| 73 | 73 | |
| 74 | - if ( !array_key_exists( 'references', $statementArray ) ) { |
|
| 74 | + if (!array_key_exists('references', $statementArray)) { |
|
| 75 | 75 | $statementArray['references'] = []; |
| 76 | 76 | } |
| 77 | 77 | $referencesArray = &$statementArray['references']; |
| 78 | 78 | |
| 79 | 79 | $referenceHash = $this->getReferenceHash(); |
| 80 | - foreach ( $referencesArray as &$potentialReferenceArray ) { |
|
| 81 | - if ( $potentialReferenceArray['hash'] === $referenceHash ) { |
|
| 80 | + foreach ($referencesArray as &$potentialReferenceArray) { |
|
| 81 | + if ($potentialReferenceArray['hash'] === $referenceHash) { |
|
| 82 | 82 | $referenceArray = &$potentialReferenceArray; |
| 83 | 83 | break; |
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | - if ( !isset( $referenceArray ) ) { |
|
| 87 | - $referenceArray = [ 'hash' => $referenceHash, 'snaks' => [] ]; |
|
| 86 | + if (!isset($referenceArray)) { |
|
| 87 | + $referenceArray = ['hash' => $referenceHash, 'snaks' => []]; |
|
| 88 | 88 | $referencesArray[] = &$referenceArray; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $snaksArray = &$referenceArray['snaks']; |
| 92 | 92 | |
| 93 | 93 | $snakPropertyId = $this->getSnakPropertyId(); |
| 94 | - if ( !array_key_exists( $snakPropertyId, $snaksArray ) ) { |
|
| 94 | + if (!array_key_exists($snakPropertyId, $snaksArray)) { |
|
| 95 | 95 | $snaksArray[$snakPropertyId] = []; |
| 96 | 96 | } |
| 97 | 97 | $propertyArray = &$snaksArray[$snakPropertyId]; |
| 98 | 98 | |
| 99 | 99 | $snakHash = $this->getSnakHash(); |
| 100 | - foreach ( $propertyArray as &$potentialSnakArray ) { |
|
| 101 | - if ( $potentialSnakArray['hash'] === $snakHash ) { |
|
| 100 | + foreach ($propertyArray as &$potentialSnakArray) { |
|
| 101 | + if ($potentialSnakArray['hash'] === $snakHash) { |
|
| 102 | 102 | $snakArray = &$potentialSnakArray; |
| 103 | 103 | break; |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | - if ( !isset( $snakArray ) ) { |
|
| 107 | - $snakArray = [ 'hash' => $snakHash ]; |
|
| 106 | + if (!isset($snakArray)) { |
|
| 107 | + $snakArray = ['hash' => $snakHash]; |
|
| 108 | 108 | $propertyArray[] = &$snakArray; |
| 109 | 109 | } |
| 110 | 110 | |