Conditions | 2 |
Paths | 2 |
Total Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function __construct(VaultConfiguration $vaultConfiguration) |
||
12 | { |
||
13 | $requiredSettings = [ |
||
14 | 'host', |
||
15 | 'username', |
||
16 | 'password', |
||
17 | ]; |
||
18 | |||
19 | $defaults = [ |
||
20 | 'port' => 21, |
||
21 | ]; |
||
22 | |||
23 | if ($missingSettings = array_diff($requiredSettings, array_keys($vaultConfiguration->getSettings()))) |
||
24 | { |
||
25 | throw new ConfigurationException("Missing mandatory setting(s): " . implode(',', $missingSettings)); |
||
26 | } |
||
27 | |||
28 | $settings = array_merge($defaults, $vaultConfiguration->getSettings()); |
||
29 | |||
30 | // atm unknown settings |
||
31 | $adapter = new \League\Flysystem\Adapter\Ftp($settings); |
||
32 | $filesystem = new Filesystem($adapter); |
||
33 | |||
34 | parent::__construct($filesystem); |
||
35 | } |
||
36 | |||
45 |