From fd7363a1e17bbd4760bfe741c5b4d873ec1a0eb3 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Thu, 23 Jul 2020 11:41:58 +0200 Subject: [PATCH] Fix broken PHPDoc comments that don't start with /** Change-Id: I8db56ff0f73873864dde260e51adcd729aa74e94 --- includes/PHPVersionCheck.php | 4 ++-- includes/SiteStatsInit.php | 2 +- includes/changes/RCCacheEntryFactory.php | 4 ++-- includes/dao/IDBAccessObject.php | 2 +- includes/diff/DifferenceEngine.php | 3 ++- includes/htmlform/CollapsibleFieldsetLayout.php | 3 ++- includes/htmlform/HTMLFormActionFieldLayout.php | 3 ++- includes/htmlform/HTMLFormFieldLayout.php | 3 ++- includes/htmlform/OOUIHTMLForm.php | 3 ++- includes/htmlform/fields/HTMLAutoCompleteSelectField.php | 3 ++- includes/htmlform/fields/HTMLButtonField.php | 3 ++- includes/htmlform/fields/HTMLCheckMatrix.php | 3 ++- includes/htmlform/fields/HTMLDateTimeField.php | 3 ++- includes/htmlform/fields/HTMLFormFieldCloner.php | 3 ++- includes/htmlform/fields/HTMLFormFieldWithButton.php | 3 ++- includes/htmlform/fields/HTMLHiddenField.php | 3 ++- includes/htmlform/fields/HTMLRestrictionsField.php | 3 ++- includes/htmlform/fields/HTMLSelectAndOtherField.php | 3 ++- includes/htmlform/fields/HTMLSelectLanguageField.php | 3 ++- includes/htmlform/fields/HTMLSelectNamespace.php | 3 ++- includes/htmlform/fields/HTMLSelectNamespaceWithButton.php | 3 ++- includes/htmlform/fields/HTMLSelectOrOtherField.php | 3 ++- includes/htmlform/fields/HTMLTextFieldWithButton.php | 3 ++- includes/htmlform/fields/HTMLTitleTextField.php | 3 ++- includes/htmlform/fields/HTMLTitlesMultiselectField.php | 3 ++- includes/htmlform/fields/HTMLUserTextField.php | 3 ++- includes/libs/rdbms/database/DatabaseMysqlBase.php | 2 +- includes/page/Article.php | 2 +- includes/specials/SpecialUserrights.php | 3 +-- includes/watcheditem/WatchedItemStore.php | 4 ++-- .../includes/linkeddata/PageDataRequestHandlerTest.php | 4 ++-- tests/phpunit/includes/page/WikiPageDbTest.php | 2 +- tests/phpunit/includes/specials/SpecialPageDataTest.php | 2 +- tests/phpunit/mocks/search/MockSearchResultSet.php | 2 +- 34 files changed, 60 insertions(+), 39 deletions(-) diff --git a/includes/PHPVersionCheck.php b/includes/PHPVersionCheck.php index 9fa28b8e085..41bdaf590ed 100644 --- a/includes/PHPVersionCheck.php +++ b/includes/PHPVersionCheck.php @@ -33,10 +33,10 @@ * it can be compatible with PHP 4, PHP 5 and PHP 7 (without warnings). */ class PHPVersionCheck { - /* @var string The number of the MediaWiki version used. */ + /** @var string The number of the MediaWiki version used. */ var $mwVersion = '1.36'; - /* @var array A mapping of PHP functions to PHP extensions. */ + /** @var string[] A mapping of PHP functions to PHP extensions. */ var $functionsExtensionsMapping = array( 'mb_substr' => 'mbstring', 'xml_parser_create' => 'xml', diff --git a/includes/SiteStatsInit.php b/includes/SiteStatsInit.php index 87886992475..1a4d3b7ebac 100644 --- a/includes/SiteStatsInit.php +++ b/includes/SiteStatsInit.php @@ -24,7 +24,7 @@ use Wikimedia\Rdbms\IDatabase; * Class designed for counting of stats. */ class SiteStatsInit { - /* @var IDatabase */ + /** @var IDatabase */ private $dbr; /** @var int */ private $edits; diff --git a/includes/changes/RCCacheEntryFactory.php b/includes/changes/RCCacheEntryFactory.php index 44211390067..1a5719e859b 100644 --- a/includes/changes/RCCacheEntryFactory.php +++ b/includes/changes/RCCacheEntryFactory.php @@ -24,10 +24,10 @@ use MediaWiki\Revision\RevisionRecord; class RCCacheEntryFactory { - /* @var IContextSource */ + /** @var IContextSource */ private $context; - /* @var string[] */ + /** @var string[] */ private $messages; /** diff --git a/includes/dao/IDBAccessObject.php b/includes/dao/IDBAccessObject.php index 92eae816bb6..a88d4f9b325 100644 --- a/includes/dao/IDBAccessObject.php +++ b/includes/dao/IDBAccessObject.php @@ -62,7 +62,7 @@ interface IDBAccessObject { /** @var int Read from the master/quorum */ public const READ_LATEST = 1; - /* @var int Read from the master/quorum and lock out other writers */ + /** @var int Read from the master/quorum and lock out other writers */ public const READ_LOCKING = self::READ_LATEST | 2; // READ_LATEST (1) and "LOCK IN SHARE MODE" (2) /** @var int Read from the master/quorum and lock out other writers and locking readers */ diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index ee22e7de799..57d83755e0a 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -200,7 +200,8 @@ class DifferenceEngine extends ContextSource { */ protected $isSlotDiffRenderer = false; - /* A set of options that will be passed to the SlotDiffRenderer upon creation + /** + * A set of options that will be passed to the SlotDiffRenderer upon creation * @var array */ private $slotDiffOptions = []; diff --git a/includes/htmlform/CollapsibleFieldsetLayout.php b/includes/htmlform/CollapsibleFieldsetLayout.php index f45e9a7306d..210669bf46b 100644 --- a/includes/htmlform/CollapsibleFieldsetLayout.php +++ b/includes/htmlform/CollapsibleFieldsetLayout.php @@ -4,8 +4,9 @@ * @stable to extend */ class CollapsibleFieldsetLayout extends OOUI\FieldsetLayout { - /* + /** * @stable to call + * @inheritDoc */ public function __construct( array $config = [] ) { parent::__construct( $config ); diff --git a/includes/htmlform/HTMLFormActionFieldLayout.php b/includes/htmlform/HTMLFormActionFieldLayout.php index 9f6045db3d7..edaaaf301c0 100644 --- a/includes/htmlform/HTMLFormActionFieldLayout.php +++ b/includes/htmlform/HTMLFormActionFieldLayout.php @@ -6,8 +6,9 @@ class HTMLFormActionFieldLayout extends OOUI\ActionFieldLayout { use HTMLFormElement; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $fieldWidget, $buttonWidget = false, array $config = [] ) { parent::__construct( $fieldWidget, $buttonWidget, $config ); diff --git a/includes/htmlform/HTMLFormFieldLayout.php b/includes/htmlform/HTMLFormFieldLayout.php index e26ab768cb8..cba2f0fe272 100644 --- a/includes/htmlform/HTMLFormFieldLayout.php +++ b/includes/htmlform/HTMLFormFieldLayout.php @@ -6,8 +6,9 @@ class HTMLFormFieldLayout extends OOUI\FieldLayout { use HTMLFormElement; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $fieldWidget, array $config = [] ) { parent::__construct( $fieldWidget, $config ); diff --git a/includes/htmlform/OOUIHTMLForm.php b/includes/htmlform/OOUIHTMLForm.php index 196f1f3e03b..e9993eee220 100644 --- a/includes/htmlform/OOUIHTMLForm.php +++ b/includes/htmlform/OOUIHTMLForm.php @@ -30,8 +30,9 @@ class OOUIHTMLForm extends HTMLForm { private $oouiErrors; private $oouiWarnings; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $descriptor, $context = null, $messagePrefix = '' ) { parent::__construct( $descriptor, $context, $messagePrefix ); diff --git a/includes/htmlform/fields/HTMLAutoCompleteSelectField.php b/includes/htmlform/fields/HTMLAutoCompleteSelectField.php index a36401af753..278cfdc27fe 100644 --- a/includes/htmlform/fields/HTMLAutoCompleteSelectField.php +++ b/includes/htmlform/fields/HTMLAutoCompleteSelectField.php @@ -35,8 +35,9 @@ class HTMLAutoCompleteSelectField extends HTMLTextField { protected $autocompleteData = []; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { $params += [ diff --git a/includes/htmlform/fields/HTMLButtonField.php b/includes/htmlform/fields/HTMLButtonField.php index 3e58ba98bc6..5aec32388cd 100644 --- a/includes/htmlform/fields/HTMLButtonField.php +++ b/includes/htmlform/fields/HTMLButtonField.php @@ -29,8 +29,9 @@ class HTMLButtonField extends HTMLFormField { protected $mFormnovalidate = false; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $info ) { $info['nodata'] = true; diff --git a/includes/htmlform/fields/HTMLCheckMatrix.php b/includes/htmlform/fields/HTMLCheckMatrix.php index 7c7a17738d9..cadd619ca60 100644 --- a/includes/htmlform/fields/HTMLCheckMatrix.php +++ b/includes/htmlform/fields/HTMLCheckMatrix.php @@ -33,8 +33,9 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { 'columns' ]; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { $missing = array_diff( self::$requiredParams, array_keys( $params ) ); diff --git a/includes/htmlform/fields/HTMLDateTimeField.php b/includes/htmlform/fields/HTMLDateTimeField.php index c1e39258aab..f356813edba 100644 --- a/includes/htmlform/fields/HTMLDateTimeField.php +++ b/includes/htmlform/fields/HTMLDateTimeField.php @@ -26,8 +26,9 @@ class HTMLDateTimeField extends HTMLTextField { protected $mType = 'datetime'; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { parent::__construct( $params ); diff --git a/includes/htmlform/fields/HTMLFormFieldCloner.php b/includes/htmlform/fields/HTMLFormFieldCloner.php index 76553f1a7be..33fa6c41d46 100644 --- a/includes/htmlform/fields/HTMLFormFieldCloner.php +++ b/includes/htmlform/fields/HTMLFormFieldCloner.php @@ -46,8 +46,9 @@ class HTMLFormFieldCloner extends HTMLFormField { */ protected $uniqueId; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { $this->uniqueId = static::class . ++self::$counter . 'x'; diff --git a/includes/htmlform/fields/HTMLFormFieldWithButton.php b/includes/htmlform/fields/HTMLFormFieldWithButton.php index 845da8dfa8c..8e95a765564 100644 --- a/includes/htmlform/fields/HTMLFormFieldWithButton.php +++ b/includes/htmlform/fields/HTMLFormFieldWithButton.php @@ -23,8 +23,9 @@ class HTMLFormFieldWithButton extends HTMLFormField { /** @var string[] Value for the button in this field */ protected $mButtonFlags = [ 'progressive' ]; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $info ) { if ( isset( $info['buttonclass'] ) ) { diff --git a/includes/htmlform/fields/HTMLHiddenField.php b/includes/htmlform/fields/HTMLHiddenField.php index bf337e2b398..b931be208b5 100644 --- a/includes/htmlform/fields/HTMLHiddenField.php +++ b/includes/htmlform/fields/HTMLHiddenField.php @@ -6,8 +6,9 @@ class HTMLHiddenField extends HTMLFormField { protected $outputAsDefault = true; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { parent::__construct( $params ); diff --git a/includes/htmlform/fields/HTMLRestrictionsField.php b/includes/htmlform/fields/HTMLRestrictionsField.php index b0e0bb9d908..7ba69819034 100644 --- a/includes/htmlform/fields/HTMLRestrictionsField.php +++ b/includes/htmlform/fields/HTMLRestrictionsField.php @@ -17,8 +17,9 @@ use Wikimedia\IPUtils; class HTMLRestrictionsField extends HTMLTextAreaField { protected const DEFAULT_ROWS = 5; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( array $params ) { parent::__construct( $params ); diff --git a/includes/htmlform/fields/HTMLSelectAndOtherField.php b/includes/htmlform/fields/HTMLSelectAndOtherField.php index d890f959939..39a05e1c721 100644 --- a/includes/htmlform/fields/HTMLSelectAndOtherField.php +++ b/includes/htmlform/fields/HTMLSelectAndOtherField.php @@ -16,8 +16,9 @@ class HTMLSelectAndOtherField extends HTMLSelectField { /** @var string[] */ private $mFlatOptions; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { if ( array_key_exists( 'other', $params ) ) { diff --git a/includes/htmlform/fields/HTMLSelectLanguageField.php b/includes/htmlform/fields/HTMLSelectLanguageField.php index 12f1ab3bf78..afe6e6bfe09 100644 --- a/includes/htmlform/fields/HTMLSelectLanguageField.php +++ b/includes/htmlform/fields/HTMLSelectLanguageField.php @@ -9,8 +9,9 @@ use MediaWiki\MediaWikiServices; */ class HTMLSelectLanguageField extends HTMLSelectField { - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { parent::__construct( $params ); diff --git a/includes/htmlform/fields/HTMLSelectNamespace.php b/includes/htmlform/fields/HTMLSelectNamespace.php index 86f56405a1a..019ff9b2cec 100644 --- a/includes/htmlform/fields/HTMLSelectNamespace.php +++ b/includes/htmlform/fields/HTMLSelectNamespace.php @@ -9,8 +9,9 @@ class HTMLSelectNamespace extends HTMLFormField { /** @var string|null */ protected $mAllValue; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { parent::__construct( $params ); diff --git a/includes/htmlform/fields/HTMLSelectNamespaceWithButton.php b/includes/htmlform/fields/HTMLSelectNamespaceWithButton.php index dd5cd28acc7..636b54a24e7 100644 --- a/includes/htmlform/fields/HTMLSelectNamespaceWithButton.php +++ b/includes/htmlform/fields/HTMLSelectNamespaceWithButton.php @@ -8,8 +8,9 @@ class HTMLSelectNamespaceWithButton extends HTMLSelectNamespace { /** @var HTMLFormFieldWithButton */ protected $mClassWithButton = null; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $info ) { $this->mClassWithButton = new HTMLFormFieldWithButton( $info ); diff --git a/includes/htmlform/fields/HTMLSelectOrOtherField.php b/includes/htmlform/fields/HTMLSelectOrOtherField.php index 829160edc9e..d2bb8ea1a9a 100644 --- a/includes/htmlform/fields/HTMLSelectOrOtherField.php +++ b/includes/htmlform/fields/HTMLSelectOrOtherField.php @@ -10,8 +10,9 @@ */ class HTMLSelectOrOtherField extends HTMLTextField { - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { parent::__construct( $params ); diff --git a/includes/htmlform/fields/HTMLTextFieldWithButton.php b/includes/htmlform/fields/HTMLTextFieldWithButton.php index 17e8b6138f8..6105acb989b 100644 --- a/includes/htmlform/fields/HTMLTextFieldWithButton.php +++ b/includes/htmlform/fields/HTMLTextFieldWithButton.php @@ -8,8 +8,9 @@ class HTMLTextFieldWithButton extends HTMLTextField { /** @var HTMLFormFieldWithButton */ protected $mClassWithButton = null; - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $info ) { $this->mClassWithButton = new HTMLFormFieldWithButton( $info ); diff --git a/includes/htmlform/fields/HTMLTitleTextField.php b/includes/htmlform/fields/HTMLTitleTextField.php index 2c56b59ec56..e58c78a580d 100644 --- a/includes/htmlform/fields/HTMLTitleTextField.php +++ b/includes/htmlform/fields/HTMLTitleTextField.php @@ -17,8 +17,9 @@ use MediaWiki\Widget\TitleInputWidget; * @since 1.26 */ class HTMLTitleTextField extends HTMLTextField { - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { $params += [ diff --git a/includes/htmlform/fields/HTMLTitlesMultiselectField.php b/includes/htmlform/fields/HTMLTitlesMultiselectField.php index 75b665fa343..c06b62364ea 100644 --- a/includes/htmlform/fields/HTMLTitlesMultiselectField.php +++ b/includes/htmlform/fields/HTMLTitlesMultiselectField.php @@ -21,8 +21,9 @@ use MediaWiki\Widget\TitlesMultiselectWidget; * @note This widget is not likely to remain functional in non-OOUI forms. */ class HTMLTitlesMultiselectField extends HTMLTitleTextField { - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { $params += [ diff --git a/includes/htmlform/fields/HTMLUserTextField.php b/includes/htmlform/fields/HTMLUserTextField.php index 99e3b71e84c..ab4a4cb5f85 100644 --- a/includes/htmlform/fields/HTMLUserTextField.php +++ b/includes/htmlform/fields/HTMLUserTextField.php @@ -18,8 +18,9 @@ use Wikimedia\IPUtils; * @since 1.26 */ class HTMLUserTextField extends HTMLTextField { - /* + /** * @stable to call + * @inheritDoc */ public function __construct( $params ) { $params = wfArrayPlus2d( $params, [ diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 469c8de7362..b09a8daae58 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -1569,7 +1569,7 @@ abstract class DatabaseMysqlBase extends Database { return 'CAST( ' . $field . ' AS SIGNED )'; } - /* + /** * @return bool Whether GTID support is used (mockable for testing) */ protected function useGTIDs() { diff --git a/includes/page/Article.php b/includes/page/Article.php index ee660fd066d..40b25c94621 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -139,7 +139,7 @@ class Article implements Page { */ private $revisionStore; - /* + /** * @var RevisionRecord|null Revision to be shown * * Initialized by getOldIDFromRequest() or fetchRevisionRecord(). Normally loaded from the diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 8e9e8e838b2..af667cfe1f3 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -36,7 +36,7 @@ class UserrightsPage extends SpecialPage { * @var null|string */ protected $mTarget; - /* + /** * @var null|User $mFetchedUser The user object of the target username or null. */ protected $mFetchedUser = null; @@ -88,7 +88,6 @@ class UserrightsPage extends SpecialPage { * * @param string|null $par String if any subpage provided, else null * @throws UserBlockedError|PermissionsError - * @suppress PhanUndeclaredMethod */ public function execute( $par ) { $user = $this->getUser(); diff --git a/includes/watcheditem/WatchedItemStore.php b/includes/watcheditem/WatchedItemStore.php index 78bb1dee975..fc62c47337d 100644 --- a/includes/watcheditem/WatchedItemStore.php +++ b/includes/watcheditem/WatchedItemStore.php @@ -630,7 +630,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac $watcherCounts = []; foreach ( $targetsWithVisitThresholds as list( $target ) ) { - /* @var LinkTarget $target */ + /** @var LinkTarget $target */ $watcherCounts[$target->getNamespace()][$target->getDBkey()] = 0; } @@ -659,7 +659,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac $missingTargets[] = $target; continue; } - /* @var LinkTarget $target */ + /** @var LinkTarget $target */ $namespaceConds[$target->getNamespace()][] = $db->makeList( [ 'wl_title = ' . $db->addQuotes( $target->getDBkey() ), $db->makeList( [ diff --git a/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php b/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php index a15e8729721..18e3f692438 100644 --- a/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php +++ b/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php @@ -217,7 +217,7 @@ class PageDataRequestHandlerTest extends \MediaWikiLangTestCase { $output = $this->makeOutputPage( $params, $headers ); $request = $output->getRequest(); - /* @var FauxResponse $response */ + /** @var FauxResponse $response */ $response = $request->response(); // construct handler @@ -298,7 +298,7 @@ class PageDataRequestHandlerTest extends \MediaWikiLangTestCase { array $headers, $expectedRedirectSuffix ) { - /* @var FauxResponse $response */ + /** @var FauxResponse $response */ $output = $this->makeOutputPage( [], $headers ); $request = $output->getRequest(); diff --git a/tests/phpunit/includes/page/WikiPageDbTest.php b/tests/phpunit/includes/page/WikiPageDbTest.php index c62e6e794ea..4be2c7d70e9 100644 --- a/tests/phpunit/includes/page/WikiPageDbTest.php +++ b/tests/phpunit/includes/page/WikiPageDbTest.php @@ -57,7 +57,7 @@ class WikiPageDbTest extends MediaWikiLangTestCase { protected function tearDown() : void { $user = $this->getTestSysop()->getUser(); foreach ( $this->pagesToDelete as $p ) { - /* @var WikiPage $p */ + /** @var WikiPage $p */ try { if ( $p->exists() ) { diff --git a/tests/phpunit/includes/specials/SpecialPageDataTest.php b/tests/phpunit/includes/specials/SpecialPageDataTest.php index 1c915256218..f3586965492 100644 --- a/tests/phpunit/includes/specials/SpecialPageDataTest.php +++ b/tests/phpunit/includes/specials/SpecialPageDataTest.php @@ -117,7 +117,7 @@ class SpecialPageDataTest extends SpecialPageTestBase { } try { - /* @var FauxResponse $response */ + /** @var FauxResponse $response */ list( $output, $response ) = $this->executeSpecialPage( $subpage, $request ); $this->assertEquals( $expCode, $response->getStatusCode(), "status code" ); diff --git a/tests/phpunit/mocks/search/MockSearchResultSet.php b/tests/phpunit/mocks/search/MockSearchResultSet.php index e6ee0160632..f44d3407b0a 100644 --- a/tests/phpunit/mocks/search/MockSearchResultSet.php +++ b/tests/phpunit/mocks/search/MockSearchResultSet.php @@ -1,7 +1,7 @@