Declare dynamic properties
authorDaimona Eaytoy <daimona.wiki@gmail.com>
Wed, 11 Sep 2019 09:30:12 +0000 (11:30 +0200)
committerDaimona Eaytoy <daimona.wiki@gmail.com>
Sat, 14 Sep 2019 13:21:26 +0000 (15:21 +0200)
This is for classes with a single undeclared property - aside from
BlockManager: I3f51fd3579514b83b567dfe20926df2f0930dc85 removed the
declaration of $permissionManager without actually removing all uses.

Change-Id: Ic2a95f77071312041be6e0633ea9b5325e98de42

12 files changed:
includes/api/ApiQueryBacklinks.php
includes/block/BlockManager.php
includes/collation/CustomUppercaseCollation.php
includes/debug/logger/ConsoleLogger.php
includes/filerepo/FileRepo.php
includes/filerepo/file/ArchivedFile.php
includes/htmlform/fields/HTMLSelectAndOtherField.php
includes/http/MWCallbackStream.php
includes/import/ImportStreamSource.php
includes/installer/InstallDocFormatter.php
includes/installer/LocalSettingsGenerator.php
includes/media/DjVuImage.php

index d21f111..a6b15e9 100644 (file)
@@ -41,6 +41,9 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
        private $redirect;
        private $bl_ns, $bl_from, $bl_from_ns, $bl_table, $bl_code, $bl_title, $bl_fields, $hasNS;
 
+       /** @var string */
+       private $helpUrl;
+
        /**
         * Maps ns and title to pageid
         *
index 2e20529..0cf5eb4 100644 (file)
@@ -41,6 +41,12 @@ use Wikimedia\IPSet;
  * @since 1.34 Refactored from User and Block.
  */
 class BlockManager {
+       /** @var PermissionManager */
+       private $permissionManager;
+
+       /** @var ServiceOptions */
+       private $options;
+
        /**
         * TODO Make this a const when HHVM support is dropped (T192166)
         *
index 170d5c2..8f4f058 100644 (file)
@@ -45,6 +45,9 @@ class CustomUppercaseCollation extends NumericUppercaseCollation {
        /** @var array $puaSubset List of private use area codes */
        private $puaSubset;
 
+       /** @var array */
+       private $firstLetters;
+
        /**
         * @note This assumes $alphabet does not contain U+F3000-U+F3FFF
         *
index a48faf1..56fc0b3 100644 (file)
@@ -10,6 +10,9 @@ use Psr\Log\AbstractLogger;
  * goal.
  */
 class ConsoleLogger extends AbstractLogger {
+       /** @var string */
+       private $channel;
+
        /**
         * @param string $channel
         */
index 42e78ff..ff8f056 100644 (file)
@@ -142,6 +142,12 @@ class FileRepo {
        /** @var WANObjectCache */
        protected $wanCache;
 
+       /**
+        * @var string
+        * @protected Use $this->getName(). Public for back-compat only
+        */
+       public $name;
+
        /**
         * @param array|null $info
         * @throws MWException
index 17fa146..b4fd176 100644 (file)
@@ -94,6 +94,9 @@ class ArchivedFile {
        /** @var Title */
        protected $title; # image title
 
+       /** @var bool */
+       private $exists;
+
        /**
         * @throws MWException
         * @param Title $title
index 354432b..05ab0bb 100644 (file)
@@ -11,6 +11,9 @@
  * @todo FIXME: If made 'required', only the text field should be compulsory.
  */
 class HTMLSelectAndOtherField extends HTMLSelectField {
+       /** @var string[] */
+       private $mFlatOptions;
+
        public function __construct( $params ) {
                if ( array_key_exists( 'other', $params ) ) {
                        // Do nothing
index a4120a3..13ab9b7 100644 (file)
@@ -29,6 +29,7 @@ use GuzzleHttp\Psr7\StreamDecoratorTrait;
  *
  * @private for use by GuzzleHttpRequest only
  * @since 1.33
+ * @property StreamInterface $stream Defined in StreamDecoratorTrait via @property, not read by phan
  */
 class MWCallbackStream implements StreamInterface {
        use StreamDecoratorTrait;
index 2f8f5dd..81e414e 100644 (file)
@@ -30,6 +30,9 @@ use MediaWiki\MediaWikiServices;
  * @ingroup SpecialPage
  */
 class ImportStreamSource implements ImportSource {
+       /** @var resource */
+       private $mHandle;
+
        /**
         * @param resource $handle
         */
index 08cfd86..eb96e05 100644 (file)
@@ -21,6 +21,9 @@
  */
 
 class InstallDocFormatter {
+       /** @var string */
+       private $text;
+
        public static function format( $text ) {
                $obj = new self( $text );
 
index a2179c6..6921361 100644 (file)
@@ -30,6 +30,7 @@
 class LocalSettingsGenerator {
 
        protected $extensions = [];
+       protected $skins = [];
        protected $values = [];
        protected $groupPermissions = [];
        protected $dbSettings = '';
index 92fad52..50b13a4 100644 (file)
@@ -42,6 +42,9 @@ class DjVuImage {
         */
        const DJVUTXT_MEMORY_LIMIT = 300000;
 
+       /** @var string */
+       private $mFilename;
+
        /**
         * @param string $filename The DjVu file name.
         */