The visibility should be declared for property $current_row.
The PSR-2 coding standard requires that all properties in a class have their visibility
explicitly declared. If you declare a property using
classA{var$property;}
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the
PSR-2.
Loading history...
15
16
public function __construct($resize_keyboard = false, $one_time_keyboard = false, $selective = false) {
17
$this->resize_keyboard = $resize_keyboard;
18
$this->one_time_keyboard = $one_time_keyboard;
19
$this->selective = $selective;
20
}
21
22
/**
23
* Create new row.
24
*
25
* @return object Standard
26
*/
27
public function addRow(){
28
$this->current_row++;
29
30
return $this;
31
}
32
33
/**
34
* Add new button to current row.
35
*
36
* @param string $text Text of the button. If none of the optional fields are used, it will be sent to the bot as a message when the button is pressed
37
* @param boolean $request_contact Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
38
* @param boolean $request_location Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
39
* @return object
40
*/
41
public function addButton(string $text, boolean $request_contact = null, boolean $request_location = null){
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.