| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function doCreateService(ServiceLocatorInterface $serviceLocator) |
||
| 19 | { |
||
| 20 | if (!class_exists(\League\Flysystem\Azure\AzureAdapter::class)) { |
||
| 21 | throw new RequirementsException( |
||
| 22 | ['league/flysystem-azure'], |
||
| 23 | 'Azure' |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | $endpoint = sprintf( |
||
| 27 | 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s', |
||
| 28 | $this->options['account-name'], |
||
| 29 | $this->options['account-key'] |
||
| 30 | ); |
||
| 31 | |||
| 32 | $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($endpoint); |
||
| 33 | $adapter = new Adapter($blobRestProxy, $this->options['container']); |
||
| 34 | |||
| 35 | return $adapter; |
||
| 36 | } |
||
| 37 | |||
| 56 |