| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | class AmazonUriFactory implements UriFactoryInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | private const ERROR_NOT_AVAILABLE = |
||
| 24 | 'The "aws/aws-sdk-php" package is supplied with the Guzzle PSR-7 ' . |
||
| 25 | 'implementation, but it is not available. Please install the ' . |
||
| 26 | '"aws/aws-sdk-php" package or use any other implementation of PSR-17 factories.' |
||
| 27 | ; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * AmazonUriFactory constructor. |
||
| 31 | */ |
||
| 32 | public function __construct() |
||
| 33 | { |
||
| 34 | $this->assertAvailable(); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $uri |
||
| 39 | * @return UriInterface |
||
| 40 | */ |
||
| 41 | public function createUri(string $uri = ''): UriInterface |
||
| 42 | { |
||
| 43 | return new Uri($uri); |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return void |
||
| 48 | */ |
||
| 49 | private function assertAvailable(): void |
||
| 56 | } |
||
| 57 | } |
||
| 58 |