X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Futils%2FMWRestrictions.php;h=caf88a15f1c83e3d7cd8f9c6b8a4c6a3dd90494c;hb=8a4a8a8dcbaf454c9f64cd8b5ba90704d7721500;hp=521e3452b8ac7611c1037768540536dacd78b6a4;hpb=6e9b4f0e9ce4ccd6089c18b205065ef7fa077484;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/utils/MWRestrictions.php b/includes/utils/MWRestrictions.php index 521e3452b8..caf88a15f1 100644 --- a/includes/utils/MWRestrictions.php +++ b/includes/utils/MWRestrictions.php @@ -27,6 +27,7 @@ class MWRestrictions { /** * @param array $restrictions + * @throws InvalidArgumentException */ protected function __construct( array $restrictions = null ) { if ( $restrictions !== null ) { @@ -44,6 +45,7 @@ class MWRestrictions { /** * @param array $restrictions * @return MWRestrictions + * @throws InvalidArgumentException */ public static function newFromArray( array $restrictions ) { return new self( $restrictions ); @@ -52,6 +54,7 @@ class MWRestrictions { /** * @param string $json JSON representation of the restrictions * @return MWRestrictions + * @throws InvalidArgumentException */ public static function newFromJson( $json ) { $restrictions = FormatJson::decode( $json, true ); @@ -69,13 +72,13 @@ class MWRestrictions { $invalidKeys = array_diff( $keys, $validKeys ); if ( $invalidKeys ) { throw new InvalidArgumentException( - 'Array contains invalid keys: ' . join( ', ', $invalidKeys ) + 'Array contains invalid keys: ' . implode( ', ', $invalidKeys ) ); } $missingKeys = array_diff( $neededKeys, $keys ); if ( $missingKeys ) { throw new InvalidArgumentException( - 'Array is missing required keys: ' . join( ', ', $missingKeys ) + 'Array is missing required keys: ' . implode( ', ', $missingKeys ) ); }