Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/201151

Change subject: Use "string|false" as @return instead of "string|bool" where 
appropiate
......................................................................

Use "string|false" as @return instead of "string|bool" where appropiate

This makes sure static analyzers don't warn for supposedly unsafe
code accessing variables as strings when they could be boolean after
having only checked against false.

https://github.com/scrutinizer-ci/php-analyzer/issues/605

Change-Id: Idb676de7587f1eccb46c12de0131bea4489a0785
---
M includes/exception/MWExceptionHandler.php
M includes/json/FormatJson.php
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/201151/1

diff --git a/includes/exception/MWExceptionHandler.php 
b/includes/exception/MWExceptionHandler.php
index 7110361..ed0f3c2 100644
--- a/includes/exception/MWExceptionHandler.php
+++ b/includes/exception/MWExceptionHandler.php
@@ -349,7 +349,7 @@
         * returns the requested URL. Otherwise, returns false.
         *
         * @since 1.23
-        * @return string|bool
+        * @return string|false
         */
        public static function getURL() {
                global $wgRequest;
@@ -428,7 +428,7 @@
         * @param Exception $e
         * @param bool $pretty Add non-significant whitespace to improve 
readability (default: false).
         * @param int $escaping Bitfield consisting of FormatJson::.*_OK class 
constants.
-        * @return string|bool JSON string if successful; false upon failure
+        * @return string|false JSON string if successful; false upon failure
         */
        public static function jsonSerializeException( Exception $e, $pretty = 
false, $escaping = 0 ) {
                global $wgLogExceptionBacktrace;
diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php
index f27194a..095811f 100644
--- a/includes/json/FormatJson.php
+++ b/includes/json/FormatJson.php
@@ -122,7 +122,7 @@
         *   readability, using that string for indentation. If true, use the 
default indent
         *   string (four spaces).
         * @param int $escaping Bitfield consisting of _OK class constants
-        * @return string|bool: String if successful; false upon failure
+        * @return string|false String if successful; false upon failure
         */
        public static function encode( $value, $pretty = false, $escaping = 0 ) 
{
                if ( !is_string( $pretty ) ) {
@@ -232,7 +232,7 @@
         * @param mixed $value
         * @param string|bool $pretty
         * @param int $escaping
-        * @return string|bool
+        * @return string|false
         */
        private static function encode54( $value, $pretty, $escaping ) {
                static $bug66021;
@@ -284,7 +284,7 @@
         * @param mixed $value
         * @param string|bool $pretty
         * @param int $escaping
-        * @return string|bool
+        * @return string|false
         */
        private static function encode53( $value, $pretty, $escaping ) {
                $options = ( $escaping & self::XMLMETA_OK ) ? 0 : ( 
JSON_HEX_TAG | JSON_HEX_AMP );

-- 
To view, visit https://gerrit.wikimedia.org/r/201151
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb676de7587f1eccb46c12de0131bea4489a0785
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to