Completed
Pull Request — master (#292)
by Carlos
03:42
created

Image::media()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 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
 * Image.php.
14
 *
15
 * @author    overtrue <[email protected]>
16
 * @copyright 2015 overtrue <[email protected]>
17
 *
18
 * @link      https://github.com/overtrue
19
 * @link      http://overtrue.me
20
 */
21
namespace EasyWeChat\Message;
22
23
/**
24
 * Class Image.
25
 *
26
 * @property string $media_id
27
 */
28
class Image extends AbstractMessage
29
{
30
    /**
31
     * Message type.
32
     *
33
     * @var string
34
     */
35
    protected $type = 'image';
36
37
    /**
38
     * Properties.
39
     *
40
     * @var array
41
     */
42
    protected $properties = ['media_id'];
43
44
    /**
45
     * Set media_id.
46
     *
47
     * @param string $mediaId
48
     *
49
     * @return Image
50
     */
51 1
    public function media($mediaId)
52
    {
53 1
        $this->setAttribute('media_id', $mediaId);
54
55 1
        return $this;
56
    }
57
}
58