@@ -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() { |
@@ -28,36 +28,36 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * @param DatabaseUpdater $updater |
30 | 30 | */ |
31 | - public static function onCreateSchema( DatabaseUpdater $updater ) { |
|
32 | - $updater->addExtensionTable( 'wbqc_constraints', __DIR__ . '/../sql/create_wbqc_constraints.sql' ); |
|
33 | - $updater->addExtensionField( 'wbqc_constraints', 'constraint_id', __DIR__ . '/../sql/patch-wbqc_constraints-constraint_id.sql' ); |
|
31 | + public static function onCreateSchema(DatabaseUpdater $updater) { |
|
32 | + $updater->addExtensionTable('wbqc_constraints', __DIR__.'/../sql/create_wbqc_constraints.sql'); |
|
33 | + $updater->addExtensionField('wbqc_constraints', 'constraint_id', __DIR__.'/../sql/patch-wbqc_constraints-constraint_id.sql'); |
|
34 | 34 | } |
35 | 35 | |
36 | - public static function onWikibaseChange( Change $change ) { |
|
36 | + public static function onWikibaseChange(Change $change) { |
|
37 | 37 | $config = MediaWikiServices::getInstance()->getMainConfig(); |
38 | - if ( $config->get( 'WBQualityConstraintsEnableConstraintsImportFromStatements' ) && |
|
39 | - self::isConstraintStatementsChange( $config, $change ) |
|
38 | + if ($config->get('WBQualityConstraintsEnableConstraintsImportFromStatements') && |
|
39 | + self::isConstraintStatementsChange($config, $change) |
|
40 | 40 | ) { |
41 | 41 | /** @var EntityChange $change */ |
42 | 42 | $title = Title::newMainPage(); |
43 | - $params = [ 'propertyId' => $change->getEntityId()->getSerialization() ]; |
|
43 | + $params = ['propertyId' => $change->getEntityId()->getSerialization()]; |
|
44 | 44 | JobQueueGroup::singleton()->push( |
45 | - new JobSpecification( 'constraintsTableUpdate', $params, [], $title ) |
|
45 | + new JobSpecification('constraintsTableUpdate', $params, [], $title) |
|
46 | 46 | ); |
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | - public static function isConstraintStatementsChange( Config $config, Change $change ) { |
|
51 | - if ( !( $change instanceof EntityChange ) || |
|
50 | + public static function isConstraintStatementsChange(Config $config, Change $change) { |
|
51 | + if (!($change instanceof EntityChange) || |
|
52 | 52 | $change->getAction() !== EntityChange::UPDATE || |
53 | - !( $change->getEntityId() instanceof PropertyId ) |
|
53 | + !($change->getEntityId() instanceof PropertyId) |
|
54 | 54 | ) { |
55 | 55 | return false; |
56 | 56 | } |
57 | 57 | |
58 | 58 | $info = $change->getInfo(); |
59 | 59 | |
60 | - if ( !array_key_exists( 'compactDiff', $info ) ) { |
|
60 | + if (!array_key_exists('compactDiff', $info)) { |
|
61 | 61 | // the non-compact diff ($info['diff']) does not contain statement diffs (T110996), |
62 | 62 | // so we only know that the change *might* affect the constraint statements |
63 | 63 | return true; |
@@ -66,18 +66,18 @@ discard block |
||
66 | 66 | /** @var EntityDiffChangedAspects $aspects */ |
67 | 67 | $aspects = $info['compactDiff']; |
68 | 68 | |
69 | - $propertyConstraintId = $config->get( 'WBQualityConstraintsPropertyConstraintId' ); |
|
70 | - return in_array( $propertyConstraintId, $aspects->getStatementChanges() ); |
|
69 | + $propertyConstraintId = $config->get('WBQualityConstraintsPropertyConstraintId'); |
|
70 | + return in_array($propertyConstraintId, $aspects->getStatementChanges()); |
|
71 | 71 | } |
72 | 72 | |
73 | - public static function onArticlePurge( WikiPage $wikiPage ) { |
|
73 | + public static function onArticlePurge(WikiPage $wikiPage) { |
|
74 | 74 | $repo = WikibaseRepo::getDefaultInstance(); |
75 | 75 | |
76 | 76 | $entityContentFactory = $repo->getEntityContentFactory(); |
77 | - if ( $entityContentFactory->isEntityContentModel( $wikiPage->getContentModel() ) ) { |
|
78 | - $entityId = $entityContentFactory->getEntityIdForTitle( $wikiPage->getTitle() ); |
|
77 | + if ($entityContentFactory->isEntityContentModel($wikiPage->getContentModel())) { |
|
78 | + $entityId = $entityContentFactory->getEntityIdForTitle($wikiPage->getTitle()); |
|
79 | 79 | $resultsCache = ResultsCache::getDefaultInstance(); |
80 | - $resultsCache->delete( $entityId ); |
|
80 | + $resultsCache->delete($entityId); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
@@ -86,18 +86,18 @@ discard block |
||
86 | 86 | * @param int $timestamp UTC timestamp (seconds since the Epoch) |
87 | 87 | * @return bool |
88 | 88 | */ |
89 | - public static function isGadgetEnabledForUserName( $userName, $timestamp ) { |
|
89 | + public static function isGadgetEnabledForUserName($userName, $timestamp) { |
|
90 | 90 | $initial = $userName[0]; |
91 | 91 | |
92 | - if ( $initial === 'Z' ) { |
|
92 | + if ($initial === 'Z') { |
|
93 | 93 | $firstWeek = 0; |
94 | - } elseif ( $initial >= 'W' && $initial < 'Z' ) { |
|
94 | + } elseif ($initial >= 'W' && $initial < 'Z') { |
|
95 | 95 | $firstWeek = 1; |
96 | - } elseif ( $initial >= 'T' && $initial < 'W' ) { |
|
96 | + } elseif ($initial >= 'T' && $initial < 'W') { |
|
97 | 97 | $firstWeek = 2; |
98 | - } elseif ( $initial >= 'N' && $initial < 'T' ) { |
|
98 | + } elseif ($initial >= 'N' && $initial < 'T') { |
|
99 | 99 | $firstWeek = 3; |
100 | - } elseif ( $initial >= 'E' && $initial < 'N' ) { |
|
100 | + } elseif ($initial >= 'E' && $initial < 'N') { |
|
101 | 101 | $firstWeek = 4; |
102 | 102 | } else { |
103 | 103 | $firstWeek = 5; |
@@ -115,27 +115,27 @@ discard block |
||
115 | 115 | return $timestamp >= $threshold; |
116 | 116 | } |
117 | 117 | |
118 | - public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) { |
|
118 | + public static function onBeforePageDisplay(OutputPage $out, Skin $skin) { |
|
119 | 119 | $repo = WikibaseRepo::getDefaultInstance(); |
120 | 120 | |
121 | 121 | $lookup = $repo->getEntityNamespaceLookup(); |
122 | 122 | $title = $out->getTitle(); |
123 | - if ( $title === null ) { |
|
123 | + if ($title === null) { |
|
124 | 124 | return; |
125 | 125 | } |
126 | 126 | |
127 | - if ( !$lookup->isEntityNamespace( $title->getNamespace() ) ) { |
|
127 | + if (!$lookup->isEntityNamespace($title->getNamespace())) { |
|
128 | 128 | return; |
129 | 129 | } |
130 | - if ( !$out->getUser()->isLoggedIn() ) { |
|
130 | + if (!$out->getUser()->isLoggedIn()) { |
|
131 | 131 | return; |
132 | 132 | } |
133 | - if ( empty( $out->getJsConfigVars()['wbIsEditView'] ) ) { |
|
133 | + if (empty($out->getJsConfigVars()['wbIsEditView'])) { |
|
134 | 134 | return; |
135 | 135 | } |
136 | 136 | |
137 | - if ( self::isGadgetEnabledForUserName( $out->getUser()->getName(), time() ) ) { |
|
138 | - $out->addModules( 'wikibase.quality.constraints.gadget' ); |
|
137 | + if (self::isGadgetEnabledForUserName($out->getUser()->getName(), time())) { |
|
138 | + $out->addModules('wikibase.quality.constraints.gadget'); |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 |
@@ -92,43 +92,43 @@ |
||
92 | 92 | return $this->referenceHash; |
93 | 93 | } |
94 | 94 | |
95 | - protected function &getMainArray( array &$container ) { |
|
96 | - $statementArray = &$this->getStatementArray( $container ); |
|
95 | + protected function &getMainArray(array &$container) { |
|
96 | + $statementArray = &$this->getStatementArray($container); |
|
97 | 97 | |
98 | - if ( !array_key_exists( 'references', $statementArray ) ) { |
|
98 | + if (!array_key_exists('references', $statementArray)) { |
|
99 | 99 | $statementArray['references'] = []; |
100 | 100 | } |
101 | 101 | $referencesArray = &$statementArray['references']; |
102 | 102 | |
103 | 103 | $referenceHash = $this->getReferenceHash(); |
104 | - foreach ( $referencesArray as &$potentialReferenceArray ) { |
|
105 | - if ( $potentialReferenceArray['hash'] === $referenceHash ) { |
|
104 | + foreach ($referencesArray as &$potentialReferenceArray) { |
|
105 | + if ($potentialReferenceArray['hash'] === $referenceHash) { |
|
106 | 106 | $referenceArray = &$potentialReferenceArray; |
107 | 107 | break; |
108 | 108 | } |
109 | 109 | } |
110 | - if ( !isset( $referenceArray ) ) { |
|
111 | - $referenceArray = [ 'hash' => $referenceHash, 'snaks' => [] ]; |
|
110 | + if (!isset($referenceArray)) { |
|
111 | + $referenceArray = ['hash' => $referenceHash, 'snaks' => []]; |
|
112 | 112 | $referencesArray[] = &$referenceArray; |
113 | 113 | } |
114 | 114 | |
115 | 115 | $snaksArray = &$referenceArray['snaks']; |
116 | 116 | |
117 | 117 | $snakPropertyId = $this->getSnakPropertyId(); |
118 | - if ( !array_key_exists( $snakPropertyId, $snaksArray ) ) { |
|
118 | + if (!array_key_exists($snakPropertyId, $snaksArray)) { |
|
119 | 119 | $snaksArray[$snakPropertyId] = []; |
120 | 120 | } |
121 | 121 | $propertyArray = &$snaksArray[$snakPropertyId]; |
122 | 122 | |
123 | 123 | $snakHash = $this->getSnakHash(); |
124 | - foreach ( $propertyArray as &$potentialSnakArray ) { |
|
125 | - if ( $potentialSnakArray['hash'] === $snakHash ) { |
|
124 | + foreach ($propertyArray as &$potentialSnakArray) { |
|
125 | + if ($potentialSnakArray['hash'] === $snakHash) { |
|
126 | 126 | $snakArray = &$potentialSnakArray; |
127 | 127 | break; |
128 | 128 | } |
129 | 129 | } |
130 | - if ( !isset( $snakArray ) ) { |
|
131 | - $snakArray = [ 'hash' => $snakHash ]; |
|
130 | + if (!isset($snakArray)) { |
|
131 | + $snakArray = ['hash' => $snakHash]; |
|
132 | 132 | $propertyArray[] = &$snakArray; |
133 | 133 | } |
134 | 134 |
@@ -80,29 +80,29 @@ |
||
80 | 80 | return $this->snakHash; |
81 | 81 | } |
82 | 82 | |
83 | - protected function &getMainArray( array &$container ) { |
|
84 | - $statementArray = &$this->getStatementArray( $container ); |
|
83 | + protected function &getMainArray(array &$container) { |
|
84 | + $statementArray = &$this->getStatementArray($container); |
|
85 | 85 | |
86 | - if ( !array_key_exists( 'qualifiers', $statementArray ) ) { |
|
86 | + if (!array_key_exists('qualifiers', $statementArray)) { |
|
87 | 87 | $statementArray['qualifiers'] = []; |
88 | 88 | } |
89 | 89 | $qualifiersArray = &$statementArray['qualifiers']; |
90 | 90 | |
91 | 91 | $snakPropertyId = $this->getSnakPropertyId(); |
92 | - if ( !array_key_exists( $snakPropertyId, $qualifiersArray ) ) { |
|
92 | + if (!array_key_exists($snakPropertyId, $qualifiersArray)) { |
|
93 | 93 | $qualifiersArray[$snakPropertyId] = []; |
94 | 94 | } |
95 | 95 | $propertyArray = &$qualifiersArray[$snakPropertyId]; |
96 | 96 | |
97 | 97 | $snakHash = $this->getSnakHash(); |
98 | - foreach ( $propertyArray as &$potentialQualifierArray ) { |
|
99 | - if ( $potentialQualifierArray['hash'] === $snakHash ) { |
|
98 | + foreach ($propertyArray as &$potentialQualifierArray) { |
|
99 | + if ($potentialQualifierArray['hash'] === $snakHash) { |
|
100 | 100 | $qualifierArray = &$potentialQualifierArray; |
101 | 101 | break; |
102 | 102 | } |
103 | 103 | } |
104 | - if ( !isset( $qualifierArray ) ) { |
|
105 | - $qualifierArray = [ 'hash' => $snakHash ]; |
|
104 | + if (!isset($qualifierArray)) { |
|
105 | + $qualifierArray = ['hash' => $snakHash]; |
|
106 | 106 | $propertyArray[] = &$qualifierArray; |
107 | 107 | } |
108 | 108 |
@@ -72,12 +72,12 @@ |
||
72 | 72 | return $this->snakHash; |
73 | 73 | } |
74 | 74 | |
75 | - protected function &getMainArray( array &$container ) { |
|
76 | - $statementArray = &$this->getStatementArray( $container ); |
|
75 | + protected function &getMainArray(array &$container) { |
|
76 | + $statementArray = &$this->getStatementArray($container); |
|
77 | 77 | |
78 | - if ( !array_key_exists( 'mainsnak', $statementArray ) ) { |
|
78 | + if (!array_key_exists('mainsnak', $statementArray)) { |
|
79 | 79 | $snakHash = $this->getSnakHash(); |
80 | - $statementArray['mainsnak'] = [ 'hash' => $snakHash ]; |
|
80 | + $statementArray['mainsnak'] = ['hash' => $snakHash]; |
|
81 | 81 | } |
82 | 82 | $mainsnakArray = &$statementArray['mainsnak']; |
83 | 83 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * @param ContextCursor $cursor |
14 | 14 | * @return array |
15 | 15 | */ |
16 | - public function serialize( ContextCursor $cursor ) { |
|
16 | + public function serialize(ContextCursor $cursor) { |
|
17 | 17 | $type = $cursor->getType(); |
18 | 18 | $serialization = [ |
19 | 19 | 't' => $type, |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | 'h' => $cursor->getSnakHash(), |
24 | 24 | ]; |
25 | 25 | |
26 | - if ( $type === Context::TYPE_QUALIFIER || $type === Context::TYPE_REFERENCE ) { |
|
26 | + if ($type === Context::TYPE_QUALIFIER || $type === Context::TYPE_REFERENCE) { |
|
27 | 27 | $serialization['P'] = $cursor->getSnakPropertyId(); |
28 | - if ( $type === Context::TYPE_REFERENCE ) { |
|
28 | + if ($type === Context::TYPE_REFERENCE) { |
|
29 | 29 | /** @var ReferenceContextCursor $cursor */ |
30 | 30 | $serialization['r'] = $cursor->getReferenceHash(); |
31 | 31 | } |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | */ |
12 | 12 | class ContextCursorDeserializer { |
13 | 13 | |
14 | - public function deserialize( array $serialization ) { |
|
15 | - switch ( $serialization['t'] ) { |
|
14 | + public function deserialize(array $serialization) { |
|
15 | + switch ($serialization['t']) { |
|
16 | 16 | case Context::TYPE_STATEMENT: |
17 | 17 | return new MainSnakContextCursor( |
18 | 18 | $serialization['i'], |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ); |
40 | 40 | default: |
41 | 41 | throw new InvalidArgumentException( |
42 | - 'Unknown serialization type ' . $serialization['t'] |
|
42 | + 'Unknown serialization type '.$serialization['t'] |
|
43 | 43 | ); |
44 | 44 | } |
45 | 45 | } |
@@ -72,27 +72,27 @@ discard block |
||
72 | 72 | * @param CheckResult $checkResult |
73 | 73 | * @return array |
74 | 74 | */ |
75 | - public function serialize( CheckResult $checkResult ) { |
|
75 | + public function serialize(CheckResult $checkResult) { |
|
76 | 76 | $contextCursor = $checkResult->getContextCursor(); |
77 | 77 | $constraint = $checkResult->getConstraint(); |
78 | 78 | $violationMessage = $checkResult->getMessage(); |
79 | 79 | $cachingMetadata = $checkResult->getMetadata()->getCachingMetadata(); |
80 | 80 | |
81 | 81 | $serialization = [ |
82 | - self::KEY_CONTEXT_CURSOR => $this->contextCursorSerializer->serialize( $contextCursor ), |
|
83 | - self::KEY_CONSTRAINT => $this->constraintSerializer->serialize( $constraint ), |
|
82 | + self::KEY_CONTEXT_CURSOR => $this->contextCursorSerializer->serialize($contextCursor), |
|
83 | + self::KEY_CONSTRAINT => $this->constraintSerializer->serialize($constraint), |
|
84 | 84 | self::KEY_CHECK_RESULT_STATUS => $checkResult->getStatus(), |
85 | - self::KEY_CACHING_METADATA => $this->serializeCachingMetadata( $cachingMetadata ), |
|
85 | + self::KEY_CACHING_METADATA => $this->serializeCachingMetadata($cachingMetadata), |
|
86 | 86 | ]; |
87 | 87 | |
88 | - if ( $violationMessage !== null ) { |
|
88 | + if ($violationMessage !== null) { |
|
89 | 89 | $serialization[self::KEY_VIOLATION_MESSAGE] = |
90 | - $this->violationMessageSerializer->serialize( $violationMessage ); |
|
90 | + $this->violationMessageSerializer->serialize($violationMessage); |
|
91 | 91 | } |
92 | 92 | |
93 | - if ( $this->serializeDependencyMetadata ) { |
|
93 | + if ($this->serializeDependencyMetadata) { |
|
94 | 94 | $serialization[self::KEY_DEPENDENCY_METADATA] = |
95 | - $this->serializeDependencyMetadata( $checkResult ); |
|
95 | + $this->serializeDependencyMetadata($checkResult); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | return $serialization; |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | * @param CachingMetadata $cachingMetadata |
103 | 103 | * @return array |
104 | 104 | */ |
105 | - private function serializeCachingMetadata( CachingMetadata $cachingMetadata ) { |
|
105 | + private function serializeCachingMetadata(CachingMetadata $cachingMetadata) { |
|
106 | 106 | $maximumAge = $cachingMetadata->getMaximumAgeInSeconds(); |
107 | 107 | |
108 | 108 | $serialization = []; |
109 | 109 | |
110 | - if ( $maximumAge > 0 ) { |
|
110 | + if ($maximumAge > 0) { |
|
111 | 111 | $serialization[self::KEY_CACHING_METADATA_MAX_AGE] = $maximumAge; |
112 | 112 | } |
113 | 113 | |
@@ -118,21 +118,21 @@ discard block |
||
118 | 118 | * @param CheckResult $checkResult |
119 | 119 | * @return array |
120 | 120 | */ |
121 | - private function serializeDependencyMetadata( CheckResult $checkResult ) { |
|
121 | + private function serializeDependencyMetadata(CheckResult $checkResult) { |
|
122 | 122 | $dependencyMetadata = $checkResult->getMetadata()->getDependencyMetadata(); |
123 | 123 | $entityIds = $dependencyMetadata->getEntityIds(); |
124 | 124 | $futureTime = $dependencyMetadata->getFutureTime(); |
125 | 125 | |
126 | 126 | $serialization = [ |
127 | 127 | self::KEY_DEPENDENCY_METADATA_ENTITY_IDS => array_map( |
128 | - function ( EntityId $entityId ) { |
|
128 | + function(EntityId $entityId) { |
|
129 | 129 | return $entityId->getSerialization(); |
130 | 130 | }, |
131 | 131 | $entityIds |
132 | 132 | ), |
133 | 133 | ]; |
134 | 134 | |
135 | - if ( $futureTime !== null ) { |
|
135 | + if ($futureTime !== null) { |
|
136 | 136 | $serialization[self::KEY_DEPENDENCY_METADATA_FUTURE_TIME] = |
137 | 137 | $futureTime->getArrayValue(); |
138 | 138 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param array $serialization |
56 | 56 | * @return CheckResult |
57 | 57 | */ |
58 | - public function deserialize( array $serialization ) { |
|
58 | + public function deserialize(array $serialization) { |
|
59 | 59 | $contextCursor = $this->contextCursorDeserializer->deserialize( |
60 | 60 | $serialization[CheckResultSerializer::KEY_CONTEXT_CURSOR] |
61 | 61 | ); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $status = $serialization[CheckResultSerializer::KEY_CHECK_RESULT_STATUS]; |
70 | 70 | |
71 | - if ( array_key_exists( CheckResultSerializer::KEY_VIOLATION_MESSAGE, $serialization ) ) { |
|
71 | + if (array_key_exists(CheckResultSerializer::KEY_VIOLATION_MESSAGE, $serialization)) { |
|
72 | 72 | $violationMessage = $this->violationMessageDeserializer->deserialize( |
73 | 73 | $serialization[CheckResultSerializer::KEY_VIOLATION_MESSAGE] |
74 | 74 | ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $serialization[CheckResultSerializer::KEY_CACHING_METADATA] |
81 | 81 | ); |
82 | 82 | |
83 | - if ( array_key_exists( CheckResultSerializer::KEY_DEPENDENCY_METADATA, $serialization ) ) { |
|
83 | + if (array_key_exists(CheckResultSerializer::KEY_DEPENDENCY_METADATA, $serialization)) { |
|
84 | 84 | $dependencyMetadata = $this->deserializeDependencyMetadata( |
85 | 85 | $serialization[CheckResultSerializer::KEY_DEPENDENCY_METADATA] |
86 | 86 | ); |
@@ -88,17 +88,17 @@ discard block |
||
88 | 88 | $dependencyMetadata = DependencyMetadata::blank(); |
89 | 89 | } |
90 | 90 | |
91 | - return ( new CheckResult( |
|
91 | + return (new CheckResult( |
|
92 | 92 | $contextCursor, |
93 | 93 | $constraint, |
94 | 94 | $parameters, |
95 | 95 | $status, |
96 | 96 | $violationMessage |
97 | - ) )->withMetadata( |
|
98 | - Metadata::merge( [ |
|
99 | - Metadata::ofCachingMetadata( $cachingMetadata ), |
|
100 | - Metadata::ofDependencyMetadata( $dependencyMetadata ), |
|
101 | - ] ) |
|
97 | + ))->withMetadata( |
|
98 | + Metadata::merge([ |
|
99 | + Metadata::ofCachingMetadata($cachingMetadata), |
|
100 | + Metadata::ofDependencyMetadata($dependencyMetadata), |
|
101 | + ]) |
|
102 | 102 | ); |
103 | 103 | } |
104 | 104 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @param array $serialization |
107 | 107 | * @return CachingMetadata |
108 | 108 | */ |
109 | - private function deserializeCachingMetadata( array $serialization ) { |
|
109 | + private function deserializeCachingMetadata(array $serialization) { |
|
110 | 110 | if ( |
111 | 111 | array_key_exists( |
112 | 112 | CheckResultSerializer::KEY_CACHING_METADATA_MAX_AGE, |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @param array $serialization |
126 | 126 | * @return DependencyMetadata |
127 | 127 | */ |
128 | - private function deserializeDependencyMetadata( array $serialization ) { |
|
128 | + private function deserializeDependencyMetadata(array $serialization) { |
|
129 | 129 | if ( |
130 | 130 | array_key_exists( |
131 | 131 | CheckResultSerializer::KEY_DEPENDENCY_METADATA_FUTURE_TIME, |
@@ -135,20 +135,20 @@ discard block |
||
135 | 135 | $futureTime = TimeValue::newFromArray( |
136 | 136 | $serialization[CheckResultSerializer::KEY_DEPENDENCY_METADATA_FUTURE_TIME] |
137 | 137 | ); |
138 | - $futureTimeDependencyMetadata = DependencyMetadata::ofFutureTime( $futureTime ); |
|
138 | + $futureTimeDependencyMetadata = DependencyMetadata::ofFutureTime($futureTime); |
|
139 | 139 | } else { |
140 | 140 | $futureTimeDependencyMetadata = DependencyMetadata::blank(); |
141 | 141 | } |
142 | 142 | |
143 | 143 | $dependencyMetadata = array_reduce( |
144 | 144 | $serialization[CheckResultSerializer::KEY_DEPENDENCY_METADATA_ENTITY_IDS], |
145 | - function ( DependencyMetadata $metadata, $entityIdSerialization ) { |
|
146 | - $entityId = $this->entityIdParser->parse( $entityIdSerialization ); |
|
145 | + function(DependencyMetadata $metadata, $entityIdSerialization) { |
|
146 | + $entityId = $this->entityIdParser->parse($entityIdSerialization); |
|
147 | 147 | |
148 | - return DependencyMetadata::merge( [ |
|
148 | + return DependencyMetadata::merge([ |
|
149 | 149 | $metadata, |
150 | - DependencyMetadata::ofEntityId( $entityId ) |
|
151 | - ] ); |
|
150 | + DependencyMetadata::ofEntityId($entityId) |
|
151 | + ]); |
|
152 | 152 | }, |
153 | 153 | $futureTimeDependencyMetadata |
154 | 154 | ); |