CardServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 9 1
1
<?php
2
3
namespace EntWeChat\Foundation\ServiceProviders;
4
5
use EntWeChat\Card\Card;
6
use Pimple\Container;
7
use Pimple\ServiceProviderInterface;
8
9
/**
10
 * Class JsServiceProvider.
11
 */
12
class CardServiceProvider implements ServiceProviderInterface
13
{
14
    /**
15
     * Registers services on the given container.
16
     *
17
     * This method should only be used to configure services and parameters.
18
     * It should not get services.
19
     *
20
     * @param Container $pimple A container instance
21
     */
22
    public function register(Container $pimple)
23
    {
24
        $pimple['card'] = function ($pimple) {
25
            $card = new Card($pimple['access_token']);
26
            $card->setCache($pimple['cache']);
27
28
            return $card;
29
        };
30
    }
31
}
32