ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 2
1
<?php
2
3
namespace EasyIM\TencentIM\Auth;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
use Tencent\TLSSigAPIv2;
8
9
/**
10
 * Class ServiceProvider
11
 *
12
 * @package EasyIM\TencentIM\Auth
13
 * @author  longing <[email protected]>
14
 */
15
class ServiceProvider implements ServiceProviderInterface
16
{
17
    /**
18
     * {@inheritdoc}.
19
     */
20
    public function register(Container $app)
21
    {
22
        !isset($app['access_token']) && $app['access_token'] = function ($app) {
23
            return new AccessToken($app);
24
        };
25
26
        $app['sign'] = function ($app) {
27
            return new TLSSigAPIv2(
28
                $app['config']['sdk_app_id'],
29
                $app['config']['secret']
30
            );
31
        };
32
    }
33
}
34