Completed
Push — master ( ee5cc4...718b8e )
by Carlos
02:52
created

QRCode   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 20
ccs 0
cts 4
cp 0
rs 10
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 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
 * QRCode.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
 * @copyright 2016
22
 *
23
 * @see      https://github.com/overtrue
24
 * @see      http://overtrue.me
25
 */
26
27
namespace EasyWeChat\MiniProgram\QRCode;
28
29
use EasyWeChat\MiniProgram\Core\AbstractMiniProgram;
30
31
class QRCode extends AbstractMiniProgram
32
{
33
    /**
34
     * API.
35
     */
36
    const API_CREATE_QRCODE = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode';
37
38
    /**
39
     * Create mini program qrcode.
40
     *
41
     * @param $path
42
     * @param int $width
43
     *
44
     * @return \EasyWeChat\Support\Collection
45
     */
46
    public function create($path, $width = 430)
47
    {
48
        return $this->parseJSON('POST', [self::API_CREATE_QRCODE, compact('path', 'width')]);
49
    }
50
}
51