Merge "Miscellaneous indentation tweaks"
[lhc/web/wiklou.git] / includes / libs / StatusValue.php
index f45dc41..e860ec4 100644 (file)
@@ -58,7 +58,7 @@ class StatusValue {
         * Factory function for fatal errors
         *
         * @param string|MessageSpecifier $message Message key or object
-        * @return StatusValue
+        * @return static
         */
        public static function newFatal( $message /*, parameters...*/ ) {
                $params = func_get_args();
@@ -71,7 +71,7 @@ class StatusValue {
         * Factory function for good results
         *
         * @param mixed $value
-        * @return StatusValue
+        * @return static
         */
        public static function newGood( $value = null ) {
                $result = new static();
@@ -83,12 +83,12 @@ class StatusValue {
         * Splits this StatusValue object into two new StatusValue objects, one which contains only
         * the error messages, and one that contains the warnings, only. The returned array is
         * defined as:
-        * array(
-        *      0 => object(StatusValue) # the StatusValue with error messages, only
-        *      1 => object(StatusValue) # The StatusValue with warning messages, only
-        * )
+        * [
+        *     0 => object(StatusValue) # the StatusValue with error messages, only
+        *     1 => object(StatusValue) # The StatusValue with warning messages, only
+        * ]
         *
-        * @return array
+        * @return StatusValue[]
         */
        public function splitByErrorType() {
                $errorsOnlyStatusValue = clone $this;
@@ -154,13 +154,13 @@ class StatusValue {
        }
 
        /**
-        * Change operation resuklt
+        * Change operation result
         *
         * @param bool $ok Whether the operation completed
         * @param mixed $value
         */
        public function setResult( $ok, $value = null ) {
-               $this->ok = $ok;
+               $this->ok = (bool)$ok;
                $this->value = $value;
        }
 
@@ -274,8 +274,8 @@ class StatusValue {
         * Note, due to the lack of tools for comparing IStatusMessage objects, this
         * function will not work when using such an object as the search parameter.
         *
-        * @param IStatusMessage|string $source Message key or object to search for
-        * @param IStatusMessage|string $dest Replacement message key or object
+        * @param MessageSpecifier|string $source Message key or object to search for
+        * @param MessageSpecifier|string $dest Replacement message key or object
         * @return bool Return true if the replacement was done, false otherwise.
         */
        public function replaceMessage( $source, $dest ) {