| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 17 | 3 | public static function createAdapter(array $config) |
|
| 18 | { |
||
| 19 | 3 | if(!isset($config['bucket']) or !is_string($config['bucket'])) { |
|
| 20 | 2 | $message = sprintf('Configuration for s3 is broken. Configuration must contains bucket parameter with string type.'); |
|
| 21 | 2 | throw new ModuleConfigException(__CLASS__, $message); |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | $client = new S3Client($config); |
|
| 25 | |||
| 26 | 1 | return new AwsS3Adapter($client, $config['bucket']); |
|
| 27 | } |
||
| 29 |