Completed
Push — master ( a55659...b9b2bf )
by mingyoung
02:04
created

ComponentDelegate::getAppId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
namespace EasyWeChat\OpenPlatform\Authorizer\OfficialAccount\OAuth;
13
14
use EasyWeChat\OpenPlatform\Application;
15
use Overtrue\Socialite\WeChatComponentInterface;
16
17
/**
18
 * Class ComponentDelegate.
19
 *
20
 * @author mingyoung <[email protected]>
21
 */
22
class ComponentDelegate implements WeChatComponentInterface
23
{
24
    /**
25
     * @var \EasyWeChat\OpenPlatform\Application
26
     */
27
    protected $app;
28
29
    /**
30
     * ComponentDelegate Constructor.
31
     *
32
     * @param \EasyWeChat\OpenPlatform\Application $app
33
     */
34
    public function __construct(Application $app)
35
    {
36
        $this->app = $app;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getAppId()
43
    {
44
        return $this->app['config']['app_id'];
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getToken()
51
    {
52
        return $this->app['access_token']->getToken()['component_access_token'];
53
    }
54
}
55