Better docs to make phan happy
authorDaimona Eaytoy <daimona.wiki@gmail.com>
Sat, 7 Sep 2019 14:38:07 +0000 (16:38 +0200)
committerKrinkle <krinklemail@gmail.com>
Sat, 7 Sep 2019 16:47:18 +0000 (16:47 +0000)
Change-Id: I8a9a6330cf1f889cbb77dfc28c93774204767323

includes/config/ConfigFactory.php
includes/config/ConfigRepository.php
includes/deferred/CdnCacheUpdate.php
includes/deferred/JobQueueEnqueueUpdate.php
includes/deferred/MessageCacheUpdate.php
includes/deferred/SiteStatsUpdate.php
includes/deferred/UserEditCountUpdate.php
includes/libs/StatusValue.php

index 696bbf4..bd174b2 100644 (file)
@@ -66,7 +66,8 @@ class ConfigFactory implements SalvageableService {
        public function salvage( SalvageableService $other ) {
                Assert::parameterType( self::class, $other, '$other' );
 
-               /** @var ConfigFactory $other */
+               /** @var self $other */
+               '@phan-var self $other';
                foreach ( $other->factoryFunctions as $name => $otherFunc ) {
                        if ( !isset( $this->factoryFunctions[$name] ) ) {
                                continue;
index d48eb0e..ceb3944 100644 (file)
@@ -188,6 +188,8 @@ class ConfigRepository implements SalvageableService {
         */
        public function salvage( SalvageableService $other ) {
                Assert::parameterType( self::class, $other, '$other' );
+               /** @var self $other */
+               '@phan-var self $other';
 
                foreach ( $other->configItems['public'] as $name => $otherConfig ) {
                        if ( isset( $this->configItems['public'][$name] ) ) {
index 66ce9a3..ddffaa3 100644 (file)
@@ -39,8 +39,9 @@ class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate {
        }
 
        public function merge( MergeableUpdate $update ) {
-               /** @var CdnCacheUpdate $update */
+               /** @var self $update */
                Assert::parameterType( __CLASS__, $update, '$update' );
+               '@phan-var self $update';
 
                $this->urls = array_merge( $this->urls, $update->urls );
        }
index 1691da2..d1b592d 100644 (file)
@@ -41,8 +41,9 @@ class JobQueueEnqueueUpdate implements DeferrableUpdate, MergeableUpdate {
        }
 
        public function merge( MergeableUpdate $update ) {
-               /** @var JobQueueEnqueueUpdate $update */
+               /** @var self $update */
                Assert::parameterType( __CLASS__, $update, '$update' );
+               '@phan-var self $update';
 
                foreach ( $update->jobsByDomain as $domain => $jobs ) {
                        $this->jobsByDomain[$domain] = $this->jobsByDomain[$domain] ?? [];
index c499d08..7f56a36 100644 (file)
@@ -42,8 +42,9 @@ class MessageCacheUpdate implements DeferrableUpdate, MergeableUpdate {
        }
 
        public function merge( MergeableUpdate $update ) {
-               /** @var MessageCacheUpdate $update */
+               /** @var self $update */
                Assert::parameterType( __CLASS__, $update, '$update' );
+               '@phan-var self $update';
 
                foreach ( $update->replacements as $code => $messages ) {
                        $this->replacements[$code] = array_merge( $this->replacements[$code] ?? [], $messages );
index 11e9337..dbd7c50 100644 (file)
@@ -56,6 +56,7 @@ class SiteStatsUpdate implements DeferrableUpdate, MergeableUpdate {
        public function merge( MergeableUpdate $update ) {
                /** @var SiteStatsUpdate $update */
                Assert::parameterType( __CLASS__, $update, '$update' );
+               '@phan-var SiteStatsUpdate $update';
 
                foreach ( self::$counters as $field ) {
                        $this->$field += $update->$field;
index 687dfbe..4333c94 100644 (file)
@@ -46,6 +46,7 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate {
        public function merge( MergeableUpdate $update ) {
                /** @var UserEditCountUpdate $update */
                Assert::parameterType( __CLASS__, $update, '$update' );
+               '@phan-var UserEditCountUpdate $update';
 
                foreach ( $update->infoByUser as $userId => $info ) {
                        if ( !isset( $this->infoByUser[$userId] ) ) {
index 71a0e34..4b381f8 100644 (file)
@@ -93,7 +93,7 @@ class StatusValue {
         *     1 => object(StatusValue) # The StatusValue with warning messages, only
         * ]
         *
-        * @return StatusValue[]
+        * @return static[]
         */
        public function splitByErrorType() {
                $errorsOnlyStatusValue = clone $this;