@@ -25,10 +25,6 @@ public function getConfigTreeBuilder()
25
25
if (!isset ($ config ['type ' ])) {
26
26
throw new InvalidConfigurationException (sprintf ('You must define a "type" for storage "%s" ' , $ name ));
27
27
}
28
- $ validTypes = ['Local ' , 'AwsS3 ' , 'Rackspace ' , 'Dropbox ' , 'Ftp ' , 'Sftp ' ];
29
- if (!in_array ($ config ['type ' ], $ validTypes )) {
30
- throw new InvalidConfigurationException (sprintf ('Type must be one of "%s", got "%s" ' , implode (', ' , $ validTypes ), $ config ['type ' ]));
31
- }
32
28
33
29
switch ($ config ['type ' ]) {
34
30
case 'Local ' :
@@ -43,12 +39,18 @@ public function getConfigTreeBuilder()
43
39
case 'Dropbox ' :
44
40
$ this ->validateAuthenticationType (['token ' , 'key ' , 'secret ' , 'app ' , 'root ' ], $ config , 'Dropbox ' );
45
41
break ;
42
+ case 'DropboxV2 ' :
43
+ $ this ->validateAuthenticationType (['token ' , 'root ' ], $ config , 'DropboxV2 ' );
44
+ break ;
46
45
case 'Ftp ' :
47
46
$ this ->validateAuthenticationType (['host ' , 'username ' , 'password ' , 'root ' , 'port ' , 'passive ' , 'ssl ' , 'timeout ' ], $ config , 'Ftp ' );
48
47
break ;
49
48
case 'Sftp ' :
50
49
$ this ->validateAuthenticationType (['host ' , 'username ' , 'password ' , 'root ' , 'port ' , 'timeout ' , 'privateKey ' ], $ config , 'Sftp ' );
51
50
break ;
51
+ default :
52
+ $ validTypes = ['Local ' , 'AwsS3 ' , 'Rackspace ' , 'Dropbox ' , 'DropboxV2 ' , 'Ftp ' , 'Sftp ' ];
53
+ throw new InvalidConfigurationException (sprintf ('Type must be one of "%s", got "%s" ' , implode (', ' , $ validTypes ), $ config ['type ' ]));
52
54
}
53
55
}
54
56
0 commit comments