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.

SetWebhook   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 65
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getCertificate() 0 3 1
A setCertificate() 0 5 1
A getUrl() 0 3 1
A setUrl() 0 5 1
A removeHook() 0 3 1
1
<?php
2
3
/**
4
 * Class that represents Telegram's Bot-API "setWebhook" 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\Traits\File;
14
use Teebot\Api\Entity\InputFile;
15
use Teebot\Api\Entity\Message;
16
17
class SetWebhook extends AbstractMethod
18
{
19
    use File;
20
21
    const NAME          = 'setWebhook';
22
23
    const RETURN_ENTITY = Message::class;
24
25
    protected $url;
26
27
    protected $certificate;
28
29
    protected $supportedProperties = [
30
        'url'         => false,
31
        'certificate' => false
32
    ];
33
34
    /**
35
     * @return mixed
36
     */
37
    public function getUrl()
38
    {
39
        return $this->url;
40
    }
41
42
    /**
43
     * @param mixed $url
44
     *
45
     * @return $this
46
     */
47
    public function setUrl($url)
48
    {
49
        $this->url = $url;
50
51
        return $this;
52
    }
53
54
    /**
55
     * Removes webhook
56
     *
57
     * @return $this
58
     */
59
    public function removeHook()
60
    {
61
        return $this->setUrl('');
62
    }
63
64
    /**
65
     * @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...
66
     */
67
    public function getCertificate()
68
    {
69
        return $this->certificate;
70
    }
71
72
    /**
73
     * @param string $certificate
74
     *
75
     * @return $this
76
     */
77
    public function setCertificate($certificate)
78
    {
79
        $this->certificate = (new InputFile($certificate))->getFileForUpload();
80
81
        return $this;
82
    }
83
}
84