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.
Completed
Pull Request — master (#16)
by Gallice
02:58
created

MessageEcho::create()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 9.2
c 0
b 0
f 0
cc 4
eloc 5
nc 8
nop 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\Callback;
4
5
class MessageEcho extends Message
6
{
7
    /**
8
     * @var bool
9
     */
10
    private $isEcho;
11
12
    /**
13
     * @var int
14
     */
15
    private $appId;
16
17
    /**
18
     * @var null|string
19
     */
20
    private $metadata;
21
22
    /**
23
     * MessageEcho constructor.
24
     *
25
     * @param bool $isEcho
26
     * @param int $appId
27
     * @param string $id
28
     * @param int $sequence
29
     * @param null|string $metadata
30
     * @param null|string $text
31
     * @param array $attachments
32
     * @param null|string $quickReply
0 ignored issues
show
Bug introduced by
There is no parameter named $quickReply. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
33
     */
34
    public function __construct($isEcho, $appId, $id, $sequence, $metadata = null, $text = null, array $attachments = [])
35
    {
36
        parent::__construct($id, $sequence, $text, $attachments);
37
        $this->isEcho = $isEcho;
38
        $this->appId = $appId;
39
        $this->metadata = $metadata;
40
    }
41
42
    /**
43
     * @return boolean
44
     */
45
    public function isEcho()
46
    {
47
        return $this->isEcho;
48
    }
49
50
    /**
51
     * @return int
52
     */
53
    public function getAppId()
54
    {
55
        return $this->appId;
56
    }
57
58
    /**
59
     * @return null|string
60
     */
61
    public function getMetadata()
62
    {
63
        return $this->metadata;
64
    }
65
66
    /**
67
     * @param array $payload
68
     *
69
     * @return static
70
     */
71 View Code Duplication
    public static function create(array $payload)
1 ignored issue
show
Duplication introduced by
This method 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...
72
    {
73
        $metadata = isset($payload['metadata']) ? $payload['metadata'] : null;
74
        $text = isset($payload['text']) ? $payload['text'] : null;
75
        $attachments = isset($payload['attachments']) ? $payload['attachments'] : [];
76
77
        return new static(true, $payload['app_id'], $payload['mid'], $payload['seq'], $metadata, $text, $attachments);
78
    }
79
}
80