Passed
Push — master ( abd03a...b605c3 )
by Carlos
03:31
created

AbstractOpenPlatform::getAppId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

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
ccs 2
cts 2
cp 1
crap 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
 * AbstractOpenPlatform.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    mingyoung <[email protected]>
21
 * @author    lixiao <[email protected]>
22
 * @copyright 2016
23
 *
24
 * @see      https://github.com/overtrue
25
 * @see      http://overtrue.me
26
 */
27
28
namespace EasyWeChat\OpenPlatform\Api;
29
30
use EasyWeChat\Core\AbstractAPI;
31
use EasyWeChat\OpenPlatform\AccessToken;
32
use Symfony\Component\HttpFoundation\Request;
33
34
abstract class AbstractOpenPlatform extends AbstractAPI
35
{
36
    /**
37
     * Request.
38
     *
39
     * @var \Symfony\Component\HttpFoundation\Request
40
     */
41
    protected $request;
42
43
    /**
44
     * AbstractOpenPlatform constructor.
45
     *
46
     * @param \EasyWeChat\OpenPlatform\AccessToken      $accessToken
47
     * @param \Symfony\Component\HttpFoundation\Request $request
48
     */
49 12
    public function __construct(AccessToken $accessToken, Request $request)
50
    {
51 12
        parent::__construct($accessToken);
52
53 12
        $this->request = $request;
54 12
    }
55
56
    /**
57
     * Get OpenPlatform AppId.
58
     *
59
     * @return string
60
     */
61 10
    public function getAppId()
62
    {
63 10
        return $this->getAccessToken()->getAppId();
64
    }
65
}
66