Passed
Pull Request — master (#1278)
by
unknown
03:33
created

ServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 2
1
<?php
2
/*
3
 * This file is part of the overtrue/wechat.
4
 *
5
 * (c) overtrue <[email protected]>
6
 *
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace EasyWeChat\OpenWork\SuiteAuth;
12
13
use Pimple\Container;
14
use Pimple\ServiceProviderInterface;
15
16
/**
17
 * ServiceProvider.
18
 *
19
 * @author xiaomin <[email protected]>
20
 */
21
class ServiceProvider implements ServiceProviderInterface
22
{
23
    /**
24
     * {@inheritdoc}.
25
     */
26
    public function register(Container $app)
27
    {
28
        $app['suite_ticket'] = function ($app) {
29
            return new SuiteTicket($app);
30
        };
31
32
        isset($app['suite_access_token']) || $app['suite_access_token'] = function ($app) {
33
            return new AccessToken($app);
34
        };
35
    }
36
}