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"
);
$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 )
);
}
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
}
$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 ) ) {
) {
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;
$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];