Article::thumb()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 6
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace EntWeChat\Message;
4
5
/**
6
 * Class Article.
7
 *
8
 * @property string $title
9
 * @property string $media_id
10
 * @property string $content
11
 * @property string $author
12
 * @property string $digest
13
 * @property string $source_url
14
 * @property string $thumb_media_id
15
 * @property string $show_cover
16
 */
17 View Code Duplication
class Article extends AbstractMessage
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /**
20
     * Properties.
21
     *
22
     * @var array
23
     */
24
    protected $properties = [
25
        'thumb_media_id',
26
        'author',
27
        'title',
28
        'content',
29
        'digest',
30
        'source_url',
31
        'show_cover',
32
    ];
33
34
    /**
35
     * Aliases of attribute.
36
     *
37
     * @var array
38
     */
39
    protected $aliases = [
40
        'source_url' => 'content_source_url',
41
        'show_cover' => 'show_cover_pic',
42
    ];
43
44
    /**
45
     * @param $mediaId
46
     *
47
     * @return $this
48
     */
49
    public function thumb($mediaId)
50
    {
51
        $this->setAttribute('thumb_media_id', $mediaId);
52
53
        return $this;
54
    }
55
}
56