Completed
Pull Request — develop (#291)
by Armando
03:51
created

Sticker::__construct()   C

Complexity

Conditions 11
Paths 94

Size

Total Lines 28
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 132

Importance

Changes 2
Bugs 0 Features 1
Metric Value
dl 0
loc 28
rs 5.2653
c 2
b 0
f 1
ccs 0
cts 22
cp 0
cc 11
eloc 16
nc 94
nop 1
crap 132

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * This file is part of the TelegramBot package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\TelegramBot\Entities;
12
13
/**
14
 * Class Sticker
15
 *
16
 * @link https://core.telegram.org/bots/api#sticker
17
 *
18
 * @method string    getFileId()   Unique identifier for this file
19
 * @method int       getWidth()    Sticker width
20
 * @method int       getHeight()   Sticker height
21
 * @method PhotoSize getThumb()    Optional. Sticker thumbnail in .webp or .jpg format
22
 * @method string    getEmoji()    Optional. Emoji associated with the sticker
23
 * @method int       getFileSize() Optional. File size
24
 */
25
class Sticker extends Entity
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function subEntities()
31
    {
32
        return [
33
            'thumb' => PhotoSize::class,
34
        ];
35
    }
36
}
37