| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function getAdapter($config): FilesystemAdapter |
||
| 29 | { |
||
| 30 | if (!isset($config['provider'])) { |
||
| 31 | throw new InvalidUploadConfigurationException('There is no provider defined.'); |
||
| 32 | } |
||
| 33 | |||
| 34 | switch ($config['provider']) { |
||
| 35 | case UploaderInterface::PROVIDER_S3: |
||
| 36 | return $this->s3Adapter->build($config); |
||
| 37 | case UploaderInterface::PROVIDER_LOCAL: |
||
| 38 | return $this->localAdapter->build($config); |
||
| 39 | default: |
||
| 40 | throw new NoUploadProviderFoundException(sprintf('There is no provider for "%s"', $config['provider'])); |
||
| 41 | } |
||
| 44 |