Passed
Push — master ( e38f5c...931b65 )
by Carlos
06:23 queued 02:38
created

ComponentVerifyTicket   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 27
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 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
 * ComponentVerifyTicket.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\EventHandlers;
29
30
use EasyWeChat\OpenPlatform\VerifyTicket;
31
use EasyWeChat\Support\Collection;
32
33
class ComponentVerifyTicket implements EventHandler
34
{
35
    /**
36
     * VerifyTicket.
37
     *
38
     * @var \EasyWeChat\OpenPlatform\VerifyTicket
39
     */
40
    protected $verifyTicket;
41
42
    /**
43
     * Constructor.
44
     *
45
     * @param \EasyWeChat\OpenPlatform\VerifyTicket $verifyTicket
46
     */
47 3
    public function __construct(VerifyTicket $verifyTicket)
48
    {
49 3
        $this->verifyTicket = $verifyTicket;
50 3
    }
51
52
    /**
53
     * {@inheritdoc}.
54
     */
55 1
    public function handle(Collection $message)
56
    {
57 1
        $this->verifyTicket->setTicket($message->get('ComponentVerifyTicket'));
58 1
    }
59
}
60