Add missing @param and @return documentation
authorUmherirrender <umherirrender_de.wp@web.de>
Fri, 11 Aug 2017 18:04:11 +0000 (20:04 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 11 Aug 2017 20:17:01 +0000 (22:17 +0200)
Change-Id: I1d1098eec3933df6561cceef646576013ddc08c8

19 files changed:
includes/AuthPlugin.php
includes/FauxRequest.php
includes/Linker.php
includes/OutputPage.php
includes/Preferences.php
includes/Title.php
includes/changes/RecentChange.php
includes/changetags/ChangeTags.php
includes/export/WikiExporter.php
includes/libs/filebackend/SwiftFileBackend.php
includes/media/MediaHandler.php
includes/media/WebP.php
includes/search/SearchEngine.php
includes/search/SearchHighlighter.php
includes/session/Token.php
includes/specialpage/LoginSignupSpecialPage.php
includes/specials/SpecialMediaStatistics.php
includes/upload/UploadBase.php
phpcs.xml

index 24ae856..b73ecbd 100644 (file)
@@ -359,6 +359,7 @@ class AuthPluginUser {
 
        /**
         * @deprecated since 1.28, use SessionManager::invalidateSessionForUser() instead.
 
        /**
         * @deprecated since 1.28, use SessionManager::invalidateSessionForUser() instead.
+        * @return bool
         */
        public function resetAuthToken() {
                # Override this!
         */
        public function resetAuthToken() {
                # Override this!
index 9147240..2f7f75b 100644 (file)
@@ -152,6 +152,7 @@ class FauxRequest extends WebRequest {
 
        /**
         * @since 1.25
 
        /**
         * @since 1.25
+        * @param string $url
         */
        public function setRequestURL( $url ) {
                $this->requestUrl = $url;
         */
        public function setRequestURL( $url ) {
                $this->requestUrl = $url;
@@ -160,6 +161,7 @@ class FauxRequest extends WebRequest {
        /**
         * @since 1.25 MWException( "getRequestURL not implemented" )
         * no longer thrown.
        /**
         * @since 1.25 MWException( "getRequestURL not implemented" )
         * no longer thrown.
+        * @return string
         */
        public function getRequestURL() {
                if ( $this->requestUrl === null ) {
         */
        public function getRequestURL() {
                if ( $this->requestUrl === null ) {
index 34cc49a..d55f0e0 100644 (file)
@@ -154,6 +154,11 @@ class Linker {
         * @since 1.16.3
         * @deprecated since 1.28, use MediaWiki\Linker\LinkRenderer instead
         * @see Linker::link
         * @since 1.16.3
         * @deprecated since 1.28, use MediaWiki\Linker\LinkRenderer instead
         * @see Linker::link
+        * @param Title $target
+        * @param string $html
+        * @param array $customAttribs
+        * @param array $query
+        * @param string|array $options
         * @return string
         */
        public static function linkKnown(
         * @return string
         */
        public static function linkKnown(
index fd002d1..2a3a7cd 100644 (file)
@@ -571,6 +571,7 @@ class OutputPage extends ContextSource {
         * @param bool $filter Whether to filter out insufficiently trustworthy modules
         * @param string|null $position If not null, only return modules with this position
         * @param string $param
         * @param bool $filter Whether to filter out insufficiently trustworthy modules
         * @param string|null $position If not null, only return modules with this position
         * @param string $param
+        * @param string $type
         * @return array Array of module names
         */
        public function getModules( $filter = false, $position = null, $param = 'mModules',
         * @return array Array of module names
         */
        public function getModules( $filter = false, $position = null, $param = 'mModules',
index 48eaaf2..039d99c 100644 (file)
@@ -1122,6 +1122,9 @@ class Preferences {
 
        /**
         * Dummy, kept for backwards-compatibility.
 
        /**
         * Dummy, kept for backwards-compatibility.
+        * @param User $user
+        * @param IContextSource $context
+        * @param array &$defaultPreferences
         */
        static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) {
        }
         */
        static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) {
        }
index 1fd1073..05f85fa 100644 (file)
@@ -1896,6 +1896,8 @@ class Title implements LinkTarget {
         * protocol-relative, the URL will be expanded to http://
         *
         * @see self::getLocalURL for the arguments.
         * protocol-relative, the URL will be expanded to http://
         *
         * @see self::getLocalURL for the arguments.
+        * @param string $query
+        * @param string|bool $query2
         * @return string The URL
         */
        public function getInternalURL( $query = '', $query2 = false ) {
         * @return string The URL
         */
        public function getInternalURL( $query = '', $query2 = false ) {
index 64c5555..f123363 100644 (file)
@@ -426,6 +426,7 @@ class RecentChange {
         * @since 1.22
         * @deprecated since 1.29 Use RCFeed::factory() instead
         * @param string $uri URI to get the engine object for
         * @since 1.22
         * @deprecated since 1.29 Use RCFeed::factory() instead
         * @param string $uri URI to get the engine object for
+        * @param array $params
         * @return RCFeedEngine The engine object
         * @throws MWException
         */
         * @return RCFeedEngine The engine object
         * @throws MWException
         */
index 608e7bb..fa98124 100644 (file)
@@ -1328,6 +1328,7 @@ class ChangeTags {
         *
         * @see listSoftwareDefinedTags
         * @deprecated since 1.28
         *
         * @see listSoftwareDefinedTags
         * @deprecated since 1.28
+        * @return array
         */
        public static function listExtensionDefinedTags() {
                wfDeprecated( __METHOD__, '1.28' );
         */
        public static function listExtensionDefinedTags() {
                wfDeprecated( __METHOD__, '1.28' );
index d512654..e0ebaa2 100644 (file)
@@ -253,6 +253,7 @@ class WikiExporter {
 
        /**
         * @param string $cond
 
        /**
         * @param string $cond
+        * @param bool $orderRevs
         * @throws MWException
         * @throws Exception
         */
         * @throws MWException
         * @throws Exception
         */
index 5d7795d..eb72edc 100644 (file)
@@ -69,7 +69,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::__construct()
 
        /**
         * @see FileBackendStore::__construct()
-        * Additional $config params include:
+        * @param array $config Params include:
         *   - swiftAuthUrl       : Swift authentication server URL
         *   - swiftUser          : Swift user used by MediaWiki (account:username)
         *   - swiftKey           : Swift authentication key for the above user
         *   - swiftAuthUrl       : Swift authentication server URL
         *   - swiftUser          : Swift user used by MediaWiki (account:username)
         *   - swiftKey           : Swift authentication key for the above user
index 502fce3..2f72181 100644 (file)
@@ -304,8 +304,10 @@ abstract class MediaHandler {
        }
 
        /**
        }
 
        /**
-       * @deprecated since 1.30, use MediaHandler::getContentHeaders instead
-       */
+        * @deprecated since 1.30, use MediaHandler::getContentHeaders instead
+        * @param array $metadata
+        * @return array
+        */
        public function getStreamHeaders( $metadata ) {
                wfDeprecated( __METHOD__, '1.30' );
                return $this->getContentHeaders( $metadata );
        public function getStreamHeaders( $metadata ) {
                wfDeprecated( __METHOD__, '1.30' );
                return $this->getContentHeaders( $metadata );
index 541cac2..3e4731a 100644 (file)
@@ -118,6 +118,7 @@ class WebPHandler extends BitmapHandler {
        /**
         * Extracts the image size and WebP type from a file based on the chunk list
         * @param array $chunks Chunks as extracted by RiffExtractor
        /**
         * Extracts the image size and WebP type from a file based on the chunk list
         * @param array $chunks Chunks as extracted by RiffExtractor
+        * @param string $filename
         * @return array Header data array with entries 'compression', 'width' and 'height', where
         * 'compression' can be 'lossy', 'lossless', 'animated' or 'unknown'
         */
         * @return array Header data array with entries 'compression', 'width' and 'height', where
         * 'compression' can be 'lossy', 'lossless', 'animated' or 'unknown'
         */
index 70117db..0cccec4 100644 (file)
@@ -566,6 +566,7 @@ abstract class SearchEngine {
        /**
         * Process completion search results.
         * Resolves the titles and rescores.
        /**
         * Process completion search results.
         * Resolves the titles and rescores.
+        * @param string $search
         * @param SearchSuggestionSet $suggestions
         * @return SearchSuggestionSet
         */
         * @param SearchSuggestionSet $suggestions
         * @return SearchSuggestionSet
         */
index 6135395..20462cf 100644 (file)
@@ -32,6 +32,7 @@ class SearchHighlighter {
        /**
         * @warning If you pass false to this constructor, then
         *  the caller is responsible for HTML escaping.
        /**
         * @warning If you pass false to this constructor, then
         *  the caller is responsible for HTML escaping.
+        * @param bool $cleanupWikitext
         */
        function __construct( $cleanupWikitext = true ) {
                $this->mCleanWikitext = $cleanupWikitext;
         */
        function __construct( $cleanupWikitext = true ) {
                $this->mCleanWikitext = $cleanupWikitext;
index 523e0cc..14d239d 100644 (file)
@@ -56,7 +56,7 @@ class Token {
         * be able to extract the timestamp.
         *
         * @param string $token
         * be able to extract the timestamp.
         *
         * @param string $token
-        * @param int|null
+        * @return int|null
         */
        public static function getTimestamp( $token ) {
                $suffixLen = strlen( self::SUFFIX );
         */
        public static function getTimestamp( $token ) {
                $suffixLen = strlen( self::SUFFIX );
index 28277bc..991d75d 100644 (file)
@@ -1247,6 +1247,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
        /**
         * Returns a string that can be appended to the URL (without encoding) to preserve the
         * return target. Does not include leading '?'/'&'.
        /**
         * Returns a string that can be appended to the URL (without encoding) to preserve the
         * return target. Does not include leading '?'/'&'.
+        * @return string
         */
        protected function getReturnToQueryStringFragment() {
                $returnto = '';
         */
        protected function getReturnToQueryStringFragment() {
                $returnto = '';
@@ -1340,6 +1341,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
 
        /**
         * @param array &$formDescriptor
 
        /**
         * @param array &$formDescriptor
+        * @param array $requests
         */
        protected function postProcessFormDescriptor( &$formDescriptor, $requests ) {
                // Pre-fill username (if not creating an account, T46775).
         */
        protected function postProcessFormDescriptor( &$formDescriptor, $requests ) {
                // Pre-fill username (if not creating an account, T46775).
@@ -1395,6 +1397,11 @@ class FakeAuthTemplate extends BaseTemplate {
        /**
         * Extensions (AntiSpoof and TitleBlacklist) call this in response to
         * UserCreateForm hook to add checkboxes to the create account form.
        /**
         * Extensions (AntiSpoof and TitleBlacklist) call this in response to
         * UserCreateForm hook to add checkboxes to the create account form.
+        * @param string $name
+        * @param string $value
+        * @param string $type
+        * @param string $msg
+        * @param string|bool $helptext
         */
        public function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
                // use the same indexes as UserCreateForm just in case someone adds an item manually
         */
        public function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
                // use the same indexes as UserCreateForm just in case someone adds an item manually
@@ -1496,6 +1503,7 @@ class LoginForm extends SpecialPage {
 
        /**
         * @deprecated since 1.27 - call LoginHelper::getValidErrorMessages instead.
 
        /**
         * @deprecated since 1.27 - call LoginHelper::getValidErrorMessages instead.
+        * @return array
         */
        public static function getValidErrorMessages() {
                return LoginHelper::getValidErrorMessages();
         */
        public static function getValidErrorMessages() {
                return LoginHelper::getValidErrorMessages();
@@ -1503,6 +1511,8 @@ class LoginForm extends SpecialPage {
 
        /**
         * @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
 
        /**
         * @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
+        * @param string $username
+        * @return array|false
         */
        public static function incrementLoginThrottle( $username ) {
                wfDeprecated( __METHOD__, "1.27" );
         */
        public static function incrementLoginThrottle( $username ) {
                wfDeprecated( __METHOD__, "1.27" );
@@ -1514,6 +1524,8 @@ class LoginForm extends SpecialPage {
 
        /**
         * @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
 
        /**
         * @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
+        * @param string $username
+        * @return bool|int
         */
        public static function incLoginThrottle( $username ) {
                wfDeprecated( __METHOD__, "1.27" );
         */
        public static function incLoginThrottle( $username ) {
                wfDeprecated( __METHOD__, "1.27" );
@@ -1523,6 +1535,8 @@ class LoginForm extends SpecialPage {
 
        /**
         * @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
 
        /**
         * @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
+        * @param string $username
+        * @return void
         */
        public static function clearLoginThrottle( $username ) {
                wfDeprecated( __METHOD__, "1.27" );
         */
        public static function clearLoginThrottle( $username ) {
                wfDeprecated( __METHOD__, "1.27" );
@@ -1559,6 +1573,7 @@ class LoginForm extends SpecialPage {
 
        /**
         * @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
 
        /**
         * @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
+        * @return string
         */
        public static function getCreateaccountToken() {
                wfDeprecated( __METHOD__, '1.27' );
         */
        public static function getCreateaccountToken() {
                wfDeprecated( __METHOD__, '1.27' );
index 83efbcb..9e07523 100644 (file)
@@ -63,6 +63,7 @@ class MediaStatisticsPage extends QueryPage {
         * come out of querycache table is the order they went in. Which is hacky.
         * However, other special pages like Special:Deadendpages and
         * Special:BrokenRedirects also rely on this.
         * come out of querycache table is the order they went in. Which is hacky.
         * However, other special pages like Special:Deadendpages and
         * Special:BrokenRedirects also rely on this.
+        * @return array
         */
        public function getQueryInfo() {
                $dbr = wfGetDB( DB_REPLICA );
         */
        public function getQueryInfo() {
                $dbr = wfGetDB( DB_REPLICA );
@@ -251,6 +252,7 @@ class MediaStatisticsPage extends QueryPage {
         * Output the start of the table
         *
         * Including opening <table>, and first <tr> with column headers.
         * Output the start of the table
         *
         * Including opening <table>, and first <tr> with column headers.
+        * @param string $mediaType
         */
        protected function outputTableStart( $mediaType ) {
                $this->getOutput()->addHTML(
         */
        protected function outputTableStart( $mediaType ) {
                $this->getOutput()->addHTML(
index 7feee85..2ee40a8 100644 (file)
@@ -1496,6 +1496,7 @@ abstract class UploadBase {
         * @param string $type PUBLIC or SYSTEM
         * @param string $publicId The well-known public identifier for the dtd
         * @param string $systemId The url for the external dtd
         * @param string $type PUBLIC or SYSTEM
         * @param string $publicId The well-known public identifier for the dtd
         * @param string $systemId The url for the external dtd
+        * @return bool|array
         */
        public static function checkSvgExternalDTD( $type, $publicId, $systemId ) {
                // This doesn't include the XHTML+MathML+SVG doctype since we don't
         */
        public static function checkSvgExternalDTD( $type, $publicId, $systemId ) {
                // This doesn't include the XHTML+MathML+SVG doctype since we don't
@@ -1521,6 +1522,7 @@ abstract class UploadBase {
         * @todo Replace this with a whitelist filter!
         * @param string $element
         * @param array $attribs
         * @todo Replace this with a whitelist filter!
         * @param string $element
         * @param array $attribs
+        * @param array $data
         * @return bool
         */
        public function checkSvgScriptCallback( $element, $attribs, $data = null ) {
         * @return bool
         */
        public function checkSvgScriptCallback( $element, $attribs, $data = null ) {
index b1ad8d2..2831a2b 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -3,11 +3,7 @@
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
                <exclude name="Generic.ControlStructures.InlineControlStructure" />
                <!-- Disable rules added in 0.8.0 that don't pass yet -->
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
                <exclude name="Generic.ControlStructures.InlineControlStructure" />
                <!-- Disable rules added in 0.8.0 that don't pass yet -->
-               <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
                <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Protected" />
                <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Public" />
                <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />
                <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Protected" />
                <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Public" />
                <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />