1 | <?php |
||
7 | class Message implements \JsonSerializable |
||
8 | { |
||
9 | const TYPE_TEXT = 'text'; |
||
10 | |||
11 | const TYPE_ATTACHMENT = 'attachment'; |
||
12 | |||
13 | /** |
||
14 | * @var string[Attachment |
||
15 | */ |
||
16 | private $type; |
||
17 | |||
18 | /** |
||
19 | * @var string[Attachment |
||
20 | */ |
||
21 | private $data; |
||
22 | |||
23 | /** |
||
24 | * @var null|QuickReply[] |
||
25 | */ |
||
26 | private $quickReplies; |
||
27 | |||
28 | /** |
||
29 | * @var null|string |
||
30 | */ |
||
31 | private $metadata; |
||
32 | |||
33 | /** |
||
34 | * @param string $type |
||
|
|||
35 | * @param string|Attachment $data |
||
36 | */ |
||
37 | 18 | public function __construct($data) |
|
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function getType() |
|
57 | |||
58 | /** |
||
59 | * @return string|Attachment |
||
60 | */ |
||
61 | 4 | public function getData() |
|
65 | |||
66 | /** |
||
67 | * @return null|QuickReply[] |
||
68 | */ |
||
69 | 3 | public function getQuickReplies() |
|
73 | |||
74 | /** |
||
75 | * @return null|string |
||
76 | */ |
||
77 | 2 | public function getMetadata() |
|
81 | |||
82 | /** |
||
83 | * @param null|QuickReply[] $quickReplies |
||
84 | */ |
||
85 | 4 | public function setQuickReplies(array $quickReplies = null) |
|
93 | |||
94 | /** |
||
95 | * @param QuickReply $quickReplies |
||
96 | */ |
||
97 | 3 | public function addQuickReply(QuickReply $quickReply) |
|
109 | |||
110 | /** |
||
111 | * @param null|string $metadata |
||
112 | */ |
||
113 | 3 | public function setMetadata($metadata = null) |
|
121 | |||
122 | /** |
||
123 | * Check if the message contains file |
||
124 | * |
||
125 | * @return bool |
||
126 | */ |
||
127 | 5 | public function hasFileToUpload() |
|
135 | |||
136 | /** |
||
137 | * Return a stream of the local file attachment |
||
138 | * |
||
139 | * @return resource|null |
||
140 | */ |
||
141 | 1 | public function getFileStream() |
|
149 | |||
150 | /** |
||
151 | * @return array |
||
152 | */ |
||
153 | 2 | public function jsonSerialize() |
|
161 | } |
||
162 |
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 methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.