Completed
Pull Request — master (#292)
by Carlos
05:19 queued 02:03
created

POIServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
/**
13
 * POIServiceProvider.php.
14
 *
15
 * Part of Overtrue\WeChat.
16
 *
17
 * For the full copyright and license information, please view the LICENSE
18
 * file that was distributed with this source code.
19
 *
20
 * @author    overtrue <[email protected]>
21
 * @copyright 2015
22
 *
23
 * @link      https://github.com/overtrue/wechat
24
 * @link      http://overtrue.me
25
 */
26
namespace EasyWeChat\Foundation\ServiceProviders;
27
28
use EasyWeChat\POI\POI;
29
use Pimple\Container;
30
use Pimple\ServiceProviderInterface;
31
32
/**
33
 * Class POIServiceProvider.
34
 */
35
class POIServiceProvider implements ServiceProviderInterface
36
{
37
    /**
38
     * Registers services on the given container.
39
     *
40
     * This method should only be used to configure services and parameters.
41
     * It should not get services.
42
     *
43
     * @param Container $pimple A container instance
44
     */
45
    public function register(Container $pimple)
46
    {
47
        $pimple['poi'] = function ($pimple) {
48
           return new POI($pimple['access_token']);
49
        };
50
    }
51
}
52