Merge "Fix typo in doc comment on MWSaltedPassword.php"
[lhc/web/wiklou.git] / includes / api / ApiResult.php
index 608e9e1..e28cb82 100644 (file)
@@ -144,7 +144,7 @@ class ApiResult implements ApiSerializable {
        private $errorFormatter;
 
        // Deprecated fields
-       private $isRawMode, $checkingSize, $mainForContinuation;
+       private $checkingSize, $mainForContinuation;
 
        /**
         * @param int|bool $maxSize Maximum result "size", or false for no limit
@@ -159,7 +159,6 @@ class ApiResult implements ApiSerializable {
                }
 
                $this->maxSize = $maxSize;
-               $this->isRawMode = false;
                $this->checkingSize = true;
                $this->reset();
        }
@@ -328,6 +327,7 @@ class ApiResult implements ApiSerializable {
        /**
         * Validate a value for addition to the result
         * @param mixed $value
+        * @return array|mixed|string
         */
        private static function validateValue( $value ) {
                global $wgContLang;
@@ -739,7 +739,7 @@ class ApiResult implements ApiSerializable {
         * Set the array data type for a path
         * @since 1.25
         * @param array|string|null $path See ApiResult::addValue()
-        * @param string $type See ApiResult::META_TYPE
+        * @param string $tag See ApiResult::META_TYPE
         * @param string $kvpKeyName See ApiResult::META_KVP_KEY_NAME
         */
        public function addArrayType( $path, $tag, $kvpKeyName = null ) {
@@ -767,7 +767,7 @@ class ApiResult implements ApiSerializable {
         * Set the array data type for a path recursively
         * @since 1.25
         * @param array|string|null $path See ApiResult::addValue()
-        * @param string $type See ApiResult::META_TYPE
+        * @param string $tag See ApiResult::META_TYPE
         * @param string $kvpKeyName See ApiResult::META_KVP_KEY_NAME
         */
        public function addArrayTypeRecursive( $path, $tag, $kvpKeyName = null ) {
@@ -797,7 +797,7 @@ class ApiResult implements ApiSerializable {
         *
         * @see ApiResult::getResultData()
         * @since 1.25
-        * @param array $data
+        * @param array $dataIn
         * @param array $transforms
         * @return array|object
         */
@@ -831,7 +831,6 @@ class ApiResult implements ApiSerializable {
 
                // BC transformations
                $boolKeys = null;
-               $forceKVP = false;
                if ( isset( $transforms['BC'] ) ) {
                        if ( !is_array( $transforms['BC'] ) ) {
                                throw new InvalidArgumentException( __METHOD__ . ':Value for "BC" must be an array' );
@@ -1205,27 +1204,23 @@ class ApiResult implements ApiSerializable {
         */
 
        /**
-        * Call this function when special elements such as '_element'
-        * are needed by the formatter, for example in XML printing.
+        * Formerly used to enable/disable "raw mode".
         * @deprecated since 1.25, you shouldn't have been using it in the first place
         * @since 1.23 $flag parameter added
         * @param bool $flag Set the raw mode flag to this state
         */
        public function setRawMode( $flag = true ) {
-               // Can't wfDeprecated() here, since we need to set this flag from
-               // ApiMain for BC with stuff using self::getIsRawMode as
-               // "self::getIsXMLMode".
-               $this->isRawMode = $flag;
+               wfDeprecated( __METHOD__, '1.25' );
        }
 
        /**
-        * Returns true whether the formatter requested raw data.
+        * Returns true, the equivalent of "raw mode" is always enabled now
         * @deprecated since 1.25, you shouldn't have been using it in the first place
         * @return bool
         */
        public function getIsRawMode() {
-               /// @todo: After Wikibase stops calling this, warn
-               return $this->isRawMode;
+               wfDeprecated( __METHOD__, '1.25' );
+               return true;
        }
 
        /**
@@ -1238,7 +1233,7 @@ class ApiResult implements ApiSerializable {
                return $this->getResultData( null, array(
                        'BC' => array(),
                        'Types' => array(),
-                       'Strip' => $this->isRawMode ? 'bc' : 'all',
+                       'Strip' => 'all',
                ) );
        }
 
@@ -1277,7 +1272,7 @@ class ApiResult implements ApiSerializable {
         */
        public static function setElement( &$arr, $name, $value, $flags = 0 ) {
                wfDeprecated( __METHOD__, '1.25' );
-               return self::setValue( $arr, $name, $value, $flags );
+               self::setValue( $arr, $name, $value, $flags );
        }
 
        /**