private $ipAddresses = [ '0.0.0.0/0', '::/0' ];
/**
- * @param array $restrictions
+ * @param array|null $restrictions
+ * @throws InvalidArgumentException
*/
protected function __construct( array $restrictions = null ) {
if ( $restrictions !== null ) {
/**
* @param array $restrictions
* @return MWRestrictions
+ * @throws InvalidArgumentException
*/
public static function newFromArray( array $restrictions ) {
return new self( $restrictions );
/**
* @param string $json JSON representation of the restrictions
* @return MWRestrictions
+ * @throws InvalidArgumentException
*/
public static function newFromJson( $json ) {
$restrictions = FormatJson::decode( $json, true );