GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SendVideo   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 56
Duplicated Lines 100 %

Importance

Changes 0
Metric Value
dl 56
loc 56
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setVideo() 5 5 1
A getVideo() 3 3 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
/**
4
 * Class that represents Telegram's Bot-API "sendVideo" method.
5
 *
6
 * @package Teebot (Telegram bot framework)
7
 *
8
 * @author Stanislav Drozdov <[email protected]>
9
 */
10
11
namespace Teebot\Api\Method;
12
13
use Teebot\Api\Entity\Message;
14
use Teebot\Api\Entity\InputFile;
15
use Teebot\Api\Traits\File;
16
17 View Code Duplication
class SendVideo extends AbstractMethod
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
    use File;
20
21
    const NAME          = 'sendVideo';
22
23
    const RETURN_ENTITY = Message::class;
24
25
    protected $chat_id;
26
27
    protected $video;
28
29
    protected $duration;
30
31
    protected $width;
32
33
    protected $height;
34
35
    protected $caption;
36
37
    protected $disable_notification;
38
39
    protected $reply_to_message_id;
40
41
    protected $reply_markup;
42
43
    protected $supportedProperties = [
44
        'chat_id'              => true,
45
        'video'                => true,
46
        'duration'             => false,
47
        'width'                => false,
48
        'height'               => false,
49
        'caption'              => false,
50
        'disable_notification' => false,
51
        'reply_to_message_id'  => false,
52
        'reply_markup'         => false
53
    ];
54
55
    /**
56
     * @return \CURLFile|string
0 ignored issues
show
Bug introduced by
The type CURLFile was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
57
     */
58
    public function getVideo()
59
    {
60
        return $this->video;
61
    }
62
63
    /**
64
     * @param string $video
65
     *
66
     * @return $this
67
     */
68
    public function setVideo($video)
69
    {
70
        $this->video = $this->initInputFile($video);
71
72
        return $this;
73
    }
74
}
75