From 544122a6c2dc7e7e383af8ebabc2f2dd3977069a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thiemo=20M=C3=A4ttig?= Date: Thu, 28 Dec 2017 16:12:08 +0100 Subject: [PATCH] Remove self-explaining "section heading" comments from classes I can see that "parent::__construct" literally calls the parent constructor. I can see that stuff preceeded by the keyword "protected" is protected. I really (really) don't need comments explaining such. Change-Id: I7458e714976a6acd3ba6a7c93fdc27d03903df83 --- includes/Linker.php | 2 -- includes/actions/WatchAction.php | 2 -- includes/context/RequestContext.php | 4 ---- includes/htmlform/HTMLFormElement.php | 4 ++-- includes/libs/CSSMin.php | 6 ------ includes/libs/JavaScriptMinifier.php | 3 --- includes/resourceloader/ResourceLoader.php | 4 ---- includes/resourceloader/ResourceLoaderFileModule.php | 3 --- includes/resourceloader/ResourceLoaderFilePath.php | 3 --- includes/resourceloader/ResourceLoaderModule.php | 4 ---- includes/resourceloader/ResourceLoaderUserTokensModule.php | 4 ---- includes/specials/pagers/ProtectedPagesPager.php | 6 ++---- includes/widget/ComplexNamespaceInputWidget.php | 1 - includes/widget/ComplexTitleInputWidget.php | 1 - includes/widget/DateInputWidget.php | 1 - includes/widget/DateTimeInputWidget.php | 1 - includes/widget/NamespaceInputWidget.php | 1 - includes/widget/SearchInputWidget.php | 1 - includes/widget/SelectWithInputWidget.php | 1 - includes/widget/TitleInputWidget.php | 1 - includes/widget/UserInputWidget.php | 1 - 21 files changed, 4 insertions(+), 50 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index 84e3103c65..c0255ac205 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -2124,8 +2124,6 @@ class Linker { return Xml::tags( 'span', [ 'class' => 'mw-revdelundel-link' ], $htmlParentheses ); } - /* Deprecated methods */ - /** * Returns the attributes for the tooltip and access key. * diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php index e12a727633..528e0e2ef1 100644 --- a/includes/actions/WatchAction.php +++ b/includes/actions/WatchAction.php @@ -80,8 +80,6 @@ class WatchAction extends FormAction { $this->getOutput()->addWikiMsg( $msgKey, $this->getTitle()->getPrefixedText() ); } - /* Static utility methods */ - /** * Watch or unwatch a page * @since 1.22 diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index c2d0de1dc9..652f0686b1 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -441,8 +441,6 @@ class RequestContext implements IContextSource, MutableContext { return $this->skin; } - /** Helpful methods **/ - /** * Get a Message object with context set * Parameters are the same as wfMessage() @@ -458,8 +456,6 @@ class RequestContext implements IContextSource, MutableContext { return call_user_func_array( 'wfMessage', $args )->setContext( $this ); } - /** Static methods **/ - /** * Get the RequestContext object associated with the main request * diff --git a/includes/htmlform/HTMLFormElement.php b/includes/htmlform/HTMLFormElement.php index 10db90cca2..66d6143329 100644 --- a/includes/htmlform/HTMLFormElement.php +++ b/includes/htmlform/HTMLFormElement.php @@ -38,8 +38,8 @@ class HTMLFormFieldLayout extends OOUI\FieldLayout { use HTMLFormElement; public function __construct( $fieldWidget, array $config = [] ) { - // Parent constructor parent::__construct( $fieldWidget, $config ); + // Traits $this->initializeHTMLFormElement( $config ); } @@ -53,8 +53,8 @@ class HTMLFormActionFieldLayout extends OOUI\ActionFieldLayout { use HTMLFormElement; public function __construct( $fieldWidget, $buttonWidget = false, array $config = [] ) { - // Parent constructor parent::__construct( $fieldWidget, $buttonWidget, $config ); + // Traits $this->initializeHTMLFormElement( $config ); } diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index ee88d0d2b5..a9cbba241a 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -29,8 +29,6 @@ */ class CSSMin { - /* Constants */ - /** @var string Strip marker for comments. **/ const PLACEHOLDER = "\x7fPLACEHOLDER\x7f"; @@ -42,8 +40,6 @@ class CSSMin { const EMBED_REGEX = '\/\*\s*\@embed\s*\*\/'; const COMMENT_REGEX = '\/\*.*?\*\/'; - /* Protected Static Members */ - /** @var array List of common image files extensions and MIME-types */ protected static $mimeTypes = [ 'gif' => 'image/gif', @@ -57,8 +53,6 @@ class CSSMin { 'svg' => 'image/svg+xml', ]; - /* Static Methods */ - /** * Get a list of local files referenced in a stylesheet (includes non-existent files). * diff --git a/includes/libs/JavaScriptMinifier.php b/includes/libs/JavaScriptMinifier.php index bbba33a7ea..ea4755efcc 100644 --- a/includes/libs/JavaScriptMinifier.php +++ b/includes/libs/JavaScriptMinifier.php @@ -18,7 +18,6 @@ */ class JavaScriptMinifier { - /* Class constants */ /* Parsing states. * The state machine is only necessary to decide whether to parse a slash as division * operator or as regexp literal. @@ -64,8 +63,6 @@ class JavaScriptMinifier { // Sanity limit to avoid excessive memory usage const STACK_LIMIT = 1000; - /* Static functions */ - /** * Returns minified JavaScript code. * diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index b2e1c49cfd..63a495a615 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -236,8 +236,6 @@ class ResourceLoader implements LoggerAwareInterface { return $data; } - /* Methods */ - /** * Register core modules and runs registration hooks. * @param Config $config [optional] @@ -1210,8 +1208,6 @@ MESSAGE; return $moduleNames; } - /* Static Methods */ - /** * Return JS code that calls mw.loader.implement with given module properties. * diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 4675191884..f2f3383f41 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -26,7 +26,6 @@ * ResourceLoader module based on local JavaScript/CSS files. */ class ResourceLoaderFileModule extends ResourceLoaderModule { - /* Protected Members */ /** @var string Local base path, see __construct() */ protected $localBasePath = ''; @@ -149,8 +148,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { */ protected $missingLocalFileRefs = []; - /* Methods */ - /** * Constructs a new module from an options array. * diff --git a/includes/resourceloader/ResourceLoaderFilePath.php b/includes/resourceloader/ResourceLoaderFilePath.php index dd239d0943..3cf09d82e1 100644 --- a/includes/resourceloader/ResourceLoaderFilePath.php +++ b/includes/resourceloader/ResourceLoaderFilePath.php @@ -26,7 +26,6 @@ * and local base path, for use with ResourceLoaderFileModule. */ class ResourceLoaderFilePath { - /* Protected Members */ /** @var string Local base path */ protected $localBasePath; @@ -38,8 +37,6 @@ class ResourceLoaderFilePath { * @var string Path to the file */ protected $path; - /* Methods */ - /** * @param string $path Path to the file. * @param string $localBasePath Base path to prepend when generating a local path. diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index b3c1cd14b7..0104ec33b9 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -65,8 +65,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface { # pages like Special:UserLogin and Special:Preferences protected $origin = self::ORIGIN_CORE_SITEWIDE; - /* Protected Members */ - protected $name = null; protected $targets = [ 'desktop' ]; @@ -94,8 +92,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface { */ protected $logger; - /* Methods */ - /** * Get this module's name. This is set when the module is registered * with ResourceLoader::register() diff --git a/includes/resourceloader/ResourceLoaderUserTokensModule.php b/includes/resourceloader/ResourceLoaderUserTokensModule.php index bfa7326d9c..e933f1f34d 100644 --- a/includes/resourceloader/ResourceLoaderUserTokensModule.php +++ b/includes/resourceloader/ResourceLoaderUserTokensModule.php @@ -26,14 +26,10 @@ */ class ResourceLoaderUserTokensModule extends ResourceLoaderModule { - /* Protected Members */ - protected $origin = self::ORIGIN_CORE_INDIVIDUAL; protected $targets = [ 'desktop', 'mobile' ]; - /* Methods */ - /** * Fetch the tokens for the current user. * diff --git a/includes/specials/pagers/ProtectedPagesPager.php b/includes/specials/pagers/ProtectedPagesPager.php index 1587abc0c7..af04703195 100644 --- a/includes/specials/pagers/ProtectedPagesPager.php +++ b/includes/specials/pagers/ProtectedPagesPager.php @@ -19,12 +19,10 @@ * @ingroup Pager */ -use \MediaWiki\Linker\LinkRenderer; +use MediaWiki\Linker\LinkRenderer; -/** - * @todo document - */ class ProtectedPagesPager extends TablePager { + public $mForm, $mConds; private $type, $level, $namespace, $sizetype, $size, $indefonly, $cascadeonly, $noredirect; diff --git a/includes/widget/ComplexNamespaceInputWidget.php b/includes/widget/ComplexNamespaceInputWidget.php index d3ada03b71..1d83f51d6f 100644 --- a/includes/widget/ComplexNamespaceInputWidget.php +++ b/includes/widget/ComplexNamespaceInputWidget.php @@ -51,7 +51,6 @@ class ComplexNamespaceInputWidget extends \OOUI\Widget { $config ); - // Parent constructor parent::__construct( $config ); // Properties diff --git a/includes/widget/ComplexTitleInputWidget.php b/includes/widget/ComplexTitleInputWidget.php index a9e80425e5..912537aaad 100644 --- a/includes/widget/ComplexTitleInputWidget.php +++ b/includes/widget/ComplexTitleInputWidget.php @@ -33,7 +33,6 @@ class ComplexTitleInputWidget extends \OOUI\Widget { $config ); - // Parent constructor parent::__construct( $config ); // Properties diff --git a/includes/widget/DateInputWidget.php b/includes/widget/DateInputWidget.php index 507dab6fac..b5163317cc 100644 --- a/includes/widget/DateInputWidget.php +++ b/includes/widget/DateInputWidget.php @@ -109,7 +109,6 @@ class DateInputWidget extends \OOUI\TextInputWidget { 'placeholder' => $placeholder, ], $config ); - // Parent constructor parent::__construct( $config ); // Calculate min/max attributes (which are skipped by TextInputWidget) and add to diff --git a/includes/widget/DateTimeInputWidget.php b/includes/widget/DateTimeInputWidget.php index f0d5cdb64f..4c412121ef 100644 --- a/includes/widget/DateTimeInputWidget.php +++ b/includes/widget/DateTimeInputWidget.php @@ -34,7 +34,6 @@ class DateTimeInputWidget extends \OOUI\InputWidget { throw new \InvalidArgumentException( '$config[\'type\'] must be specified' ); } - // Parent constructor parent::__construct( $config ); // Properties, which are ignored in PHP and just shipped back to JS diff --git a/includes/widget/NamespaceInputWidget.php b/includes/widget/NamespaceInputWidget.php index 3e913b02ff..5fdc7104ff 100644 --- a/includes/widget/NamespaceInputWidget.php +++ b/includes/widget/NamespaceInputWidget.php @@ -24,7 +24,6 @@ class NamespaceInputWidget extends \OOUI\DropdownInputWidget { // Configuration initialization $config['options'] = $this->getNamespaceDropdownOptions( $config ); - // Parent constructor parent::__construct( $config ); // Properties diff --git a/includes/widget/SearchInputWidget.php b/includes/widget/SearchInputWidget.php index 773c291dfc..70b0dcc1bd 100644 --- a/includes/widget/SearchInputWidget.php +++ b/includes/widget/SearchInputWidget.php @@ -34,7 +34,6 @@ class SearchInputWidget extends TitleInputWidget { 'icon' => 'search', ], $config ); - // Parent constructor parent::__construct( $config ); // Properties, which are ignored in PHP and just shipped back to JS diff --git a/includes/widget/SelectWithInputWidget.php b/includes/widget/SelectWithInputWidget.php index d2dda75e54..3abfbd0af4 100644 --- a/includes/widget/SelectWithInputWidget.php +++ b/includes/widget/SelectWithInputWidget.php @@ -38,7 +38,6 @@ class SelectWithInputWidget extends \OOUI\Widget { $config ); - // Parent constructor parent::__construct( $config ); // Properties diff --git a/includes/widget/TitleInputWidget.php b/includes/widget/TitleInputWidget.php index da2e94bba3..a29c3dc3e6 100644 --- a/includes/widget/TitleInputWidget.php +++ b/includes/widget/TitleInputWidget.php @@ -30,7 +30,6 @@ class TitleInputWidget extends \OOUI\TextInputWidget { * be a valid title (default: true) */ public function __construct( array $config = [] ) { - // Parent constructor parent::__construct( array_merge( [ 'maxLength' => 255 ], $config ) ); diff --git a/includes/widget/UserInputWidget.php b/includes/widget/UserInputWidget.php index d591ad1341..a058ab6596 100644 --- a/includes/widget/UserInputWidget.php +++ b/includes/widget/UserInputWidget.php @@ -16,7 +16,6 @@ class UserInputWidget extends \OOUI\TextInputWidget { * @param array $config Configuration options */ public function __construct( array $config = [] ) { - // Parent constructor parent::__construct( $config ); // Initialization -- 2.20.1