Cast API timeSpentBackend to an int
[lhc/web/wiklou.git] / includes / api / ApiResult.php
index f70bbe7..3436320 100644 (file)
@@ -312,7 +312,7 @@ class ApiResult implements ApiSerializable {
                        if ( !$conflicts ) {
                                $arr[$name] += $value;
                        } else {
-                               $keys = join( ', ', array_keys( $conflicts ) );
+                               $keys = implode( ', ', array_keys( $conflicts ) );
                                throw new RuntimeException(
                                        "Conflicting keys ($keys) when attempting to merge element $name"
                                );
@@ -340,7 +340,7 @@ class ApiResult implements ApiSerializable {
                                $value = $value->serializeForApiResult();
                                if ( is_object( $value ) ) {
                                        throw new UnexpectedValueException(
-                                               get_class( $oldValue ) . "::serializeForApiResult() returned an object of class " .
+                                               get_class( $oldValue ) . '::serializeForApiResult() returned an object of class ' .
                                                        get_class( $value )
                                        );
                                }
@@ -351,7 +351,7 @@ class ApiResult implements ApiSerializable {
                                        return self::validateValue( $value );
                                } catch ( Exception $ex ) {
                                        throw new UnexpectedValueException(
-                                               get_class( $oldValue ) . "::serializeForApiResult() returned an invalid value: " .
+                                               get_class( $oldValue ) . '::serializeForApiResult() returned an invalid value: ' .
                                                        $ex->getMessage(),
                                                0,
                                                $ex
@@ -372,7 +372,7 @@ class ApiResult implements ApiSerializable {
                        }
                        $value = $tmp;
                } elseif ( is_float( $value ) && !is_finite( $value ) ) {
-                       throw new InvalidArgumentException( "Cannot add non-finite floats to ApiResult" );
+                       throw new InvalidArgumentException( 'Cannot add non-finite floats to ApiResult' );
                } elseif ( is_string( $value ) ) {
                        $value = $wgContLang->normalize( $value );
                } elseif ( $value !== null && !is_scalar( $value ) ) {
@@ -538,7 +538,7 @@ class ApiResult implements ApiSerializable {
                ) {
                        throw new RuntimeException(
                                "Attempting to set content element as $name when " . $arr[self::META_CONTENT] .
-                                       " is already set as the content element"
+                                       ' is already set as the content element'
                        );
                }
                $arr[self::META_CONTENT] = $name;
@@ -1132,12 +1132,12 @@ class ApiResult implements ApiSerializable {
                                                $tmp = [];
                                                return $tmp;
                                        default:
-                                               $fail = join( '.', array_slice( $path, 0, $i + 1 ) );
+                                               $fail = implode( '.', array_slice( $path, 0, $i + 1 ) );
                                                throw new InvalidArgumentException( "Path $fail does not exist" );
                                }
                        }
                        if ( !is_array( $ret[$k] ) ) {
-                               $fail = join( '.', array_slice( $path, 0, $i + 1 ) );
+                               $fail = implode( '.', array_slice( $path, 0, $i + 1 ) );
                                throw new InvalidArgumentException( "Path $fail is not an array" );
                        }
                        $ret = &$ret[$k];