Completed
Push — master ( 396778...5e0c6d )
by Changwan
03:27
created

SqsServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 13 1
A boot() 0 3 1
1
<?php
2
namespace Wandu\Q\Providers;
3
4
use Aws\Sqs\SqsClient;
5
use Pheanstalk\PheanstalkInterface;
6
use Wandu\DI\ContainerInterface;
7
use Wandu\DI\ServiceProviderInterface;
8
use function Wandu\Foundation\config;
9
10
class SqsServiceProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function register(ContainerInterface $app)
16
    {
17
        $app->closure(PheanstalkInterface::class, function () {
18
            return new SqsClient([
19
                'version' => 'latest',
20
                'credentials' => [
21
                    'key' => config('aws.sqs.key'),
22
                    'secret' => config('aws.sqs.secret'),
23
                ],
24
                'region' => config('aws.sqs.region'),
25
            ]);
26
        });
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function boot(ContainerInterface $app)
33
    {
34
    }
35
}
36