| 1 | <?php |
||
| 13 | class DropboxAdapterFactory extends AbstractAdapterFactory |
||
| 14 | { |
||
| 15 | public function doCreateService(ContainerInterface $container): AdapterInterface |
||
| 16 | { |
||
| 17 | if (! class_exists(\Spatie\FlysystemDropbox\DropboxAdapter::class)) { |
||
| 18 | throw new RequirementsException( |
||
| 19 | ['spatie/flysystem-dropbox'], |
||
| 20 | 'Dropbox' |
||
| 21 | ); |
||
| 22 | } |
||
| 23 | |||
| 24 | $client = new \Spatie\Dropbox\Client( |
||
| 25 | $this->options['access_token'] |
||
| 26 | ); |
||
| 27 | |||
| 28 | $adapter = new Adapter($client, $this->options['prefix']); |
||
| 29 | |||
| 30 | return $adapter; |
||
| 31 | } |
||
| 32 | |||
| 33 | 2 | protected function validateConfig() |
|
| 43 | } |
||
| 44 |