| Conditions | 3 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 3.1406 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | 132 | public function register(): void |
|
| 12 | { |
||
| 13 | $this->app->bind(S3ClientInterface::class, static function (): ?AwsClientInterface { |
||
| 14 | // If these two values are not configured in .env, AWS will attempt initializing |
||
| 15 | // the client with null values and throw an error. |
||
| 16 | 13 | if (!config('aws.credentials.key') || !config('aws.credentials.secret')) { |
|
| 17 | 13 | return null; |
|
| 18 | } |
||
| 19 | |||
| 20 | return app('aws')->createClient('s3'); |
||
| 21 | 132 | }); |
|
| 24 |