Merge "Update docblocks for methods potentially returning null"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 15 Sep 2019 16:27:34 +0000 (16:27 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 15 Sep 2019 16:27:34 +0000 (16:27 +0000)
includes/EditPage.php
includes/GlobalFunctions.php
includes/WebRequest.php
includes/actions/SpecialPageAction.php
includes/api/ApiQueryQueryPage.php
includes/import/WikiImporter.php
includes/parser/CoreParserFunctions.php
includes/site/MediaWikiSite.php
includes/site/Site.php

index 23d6ef9..9d89785 100644 (file)
@@ -2742,7 +2742,7 @@ ERROR;
         * content.
         *
         * @param Content|null|bool|string $content
-        * @return string The editable text form of the content.
+        * @return string|false|null The editable text form of the content.
         *
         * @throws MWException If $content is not an instance of TextContent and
         *   $this->allowNonTextContent is not true.
index 38daab5..3b4e657 100644 (file)
@@ -1816,10 +1816,11 @@ function mimeTypeMatch( $type, $avail ) {
  *
  * @param array $cprefs Client's acceptable type list
  * @param array $sprefs Server's offered types
- * @return string
+ * @return string|null
  *
  * @todo FIXME: Doesn't handle params like 'text/plain; charset=UTF-8'
  * XXX: generalize to negotiate other stuff
+ * @todo The function appears unused. Is it worth to keep?
  */
 function wfNegotiateType( $cprefs, $sprefs ) {
        $combine = [];
index a48d032..c94e8d4 100644 (file)
@@ -547,7 +547,7 @@ class WebRequest {
         *
         * @param string $name
         * @param array|null $default Option default (or null)
-        * @return array Array of ints
+        * @return int[]|null
         */
        public function getIntArray( $name, $default = null ) {
                $val = $this->getArray( $name, $default );
index 8a231cb..56be456 100644 (file)
@@ -35,6 +35,9 @@ class SpecialPageAction extends FormlessAction {
                'editchangetags' => 'EditTags',
        ];
 
+       /**
+        * @inheritDoc
+        */
        public function getName() {
                $request = $this->getRequest();
                $actionName = $request->getVal( 'action', 'view' );
index 26c17c5..12e908f 100644 (file)
@@ -61,7 +61,7 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase {
         * @param string $name
         * @return QueryPage
         */
-       private function getSpecialPage( $name ) {
+       private function getSpecialPage( $name ) : QueryPage {
                $qp = $this->specialPageFactory->getPage( $name );
                if ( !$qp ) {
                        self::dieDebug(
index 0d1cc68..6eba4f3 100644 (file)
@@ -33,7 +33,8 @@ use MediaWiki\MediaWikiServices;
  * @ingroup SpecialPage
  */
 class WikiImporter {
-       private $reader = null;
+       /** @var XMLReader */
+       private $reader;
        private $foreignNamespaces = null;
        private $mLogItemCallback, $mUploadCallback, $mRevisionCallback, $mPageCallback;
        private $mSiteInfoCallback, $mPageOutCallback;
index e1f4f38..b803241 100644 (file)
@@ -1121,7 +1121,7 @@ class CoreParserFunctions {
         * @param Parser $parser
         * @param Title $title
         * @param string $vary ParserOuput vary-* flag
-        * @return Revision
+        * @return Revision|null
         * @since 1.23
         */
        private static function getCachedRevisionObject( $parser, $title, $vary ) {
index 14c9a73..3e2a9a2 100644 (file)
@@ -176,7 +176,7 @@ class MediaWikiSite extends Site {
         *
         * @param string|bool $pageName Page name or false (default: false)
         *
-        * @return string
+        * @return string|bool|null
         */
        public function getPageUrl( $pageName = false ) {
                $url = $this->getLinkPath();
index bcf8b32..10711a6 100644 (file)
@@ -365,7 +365,7 @@ class Site implements Serializable {
         *
         * @param bool|string $pageName
         *
-        * @return string|bool
+        * @return string|bool|null
         */
        public function getPageUrl( $pageName = false ) {
                $url = $this->getLinkPath();