@@ -25,10 +25,6 @@ public function getConfigTreeBuilder()
2525 if (!isset ($ config ['type ' ])) {
2626 throw new InvalidConfigurationException (sprintf ('You must define a "type" for storage "%s" ' , $ name ));
2727 }
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- }
3228
3329 switch ($ config ['type ' ]) {
3430 case 'Local ' :
@@ -43,12 +39,18 @@ public function getConfigTreeBuilder()
4339 case 'Dropbox ' :
4440 $ this ->validateAuthenticationType (['token ' , 'key ' , 'secret ' , 'app ' , 'root ' ], $ config , 'Dropbox ' );
4541 break ;
42+ case 'DropboxV2 ' :
43+ $ this ->validateAuthenticationType (['token ' , 'root ' ], $ config , 'DropboxV2 ' );
44+ break ;
4645 case 'Ftp ' :
4746 $ this ->validateAuthenticationType (['host ' , 'username ' , 'password ' , 'root ' , 'port ' , 'passive ' , 'ssl ' , 'timeout ' ], $ config , 'Ftp ' );
4847 break ;
4948 case 'Sftp ' :
5049 $ this ->validateAuthenticationType (['host ' , 'username ' , 'password ' , 'root ' , 'port ' , 'timeout ' , 'privateKey ' ], $ config , 'Sftp ' );
5150 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 ' ]));
5254 }
5355 }
5456
0 commit comments