@@ -46,7 +46,7 @@ |
||
| 46 | 46 | public static function paginateItems( |
| 47 | 47 | $items, |
| 48 | 48 | int $index, |
| 49 | - Keyboard &$keyboard, |
|
| 49 | + Keyboard & $keyboard, |
|
| 50 | 50 | callable $format_item, |
| 51 | 51 | int $item_per_page = 3, |
| 52 | 52 | string $prefix = 'list', |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @param CoreBot $bot References to the bot that's using the inline keyboard. |
| 39 | 39 | * @param array $buttons Buttons passed as inizialization. |
| 40 | 40 | */ |
| 41 | - public function __construct(CoreBot &$bot, array $buttons = array()) |
|
| 41 | + public function __construct(CoreBot & $bot, array $buttons = array()) |
|
| 42 | 42 | { |
| 43 | 43 | $this->bot = $bot; |
| 44 | 44 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function getBackButton(bool $json_serialized = true) |
| 56 | 56 | { |
| 57 | 57 | // Create the button |
| 58 | - $inline_keyboard = [ 'inline_keyboard' => |
|
| 58 | + $inline_keyboard = ['inline_keyboard' => |
|
| 59 | 59 | [ |
| 60 | 60 | [ |
| 61 | 61 | [ |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | public function getBackSkipKeyboard(bool $json_serialized = true) |
| 91 | 91 | { |
| 92 | 92 | // Create the keyboard |
| 93 | - $inline_keyboard = [ 'inline_keyboard' => |
|
| 93 | + $inline_keyboard = ['inline_keyboard' => |
|
| 94 | 94 | [ |
| 95 | 95 | [ |
| 96 | 96 | [ |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | * @{ |
| 87 | 87 | */ |
| 88 | 88 | |
| 89 | - public function __construct(BasicBot &$bot) |
|
| 89 | + public function __construct(BasicBot & $bot) |
|
| 90 | 90 | { |
| 91 | 91 | $this->bot = $bot; |
| 92 | 92 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | /** \brief Current user/group language. */ |
| 48 | 48 | public $language; |
| 49 | 49 | |
| 50 | - public function __construct(BasicBot &$bot) |
|
| 50 | + public function __construct(BasicBot & $bot) |
|
| 51 | 51 | { |
| 52 | 52 | $this->bot = $bot; |
| 53 | 53 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * \brief Create a Database handler object. |
| 50 | 50 | * @param BasicBot $bot Reference to the bot that use this object. |
| 51 | 51 | */ |
| 52 | - public function __construct(BasicBot &$bot) |
|
| 52 | + public function __construct(BasicBot & $bot) |
|
| 53 | 53 | { |
| 54 | 54 | $this->bot = $bot; |
| 55 | 55 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public static function addDefaultValue(array $params) : array |
| 96 | 96 | { |
| 97 | - static $defaults = [ 'adapter' => PDO_DEFAULT_ADAPTER, 'host' => 'localhost', 'options' => [] ]; |
|
| 97 | + static $defaults = ['adapter' => PDO_DEFAULT_ADAPTER, 'host' => 'localhost', 'options' => []]; |
|
| 98 | 98 | return array_merge($defaults, $params); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public function __construct(string $command, callable $script, string ...$chars) |
| 63 | 63 | { |
| 64 | 64 | $chars_count = count($chars); |
| 65 | - if ( $chars_count === 0) |
|
| 65 | + if ($chars_count === 0) |
|
| 66 | 66 | { |
| 67 | 67 | throw new BotException("No character given for matching the command"); |
| 68 | 68 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | else |
| 75 | 75 | { |
| 76 | 76 | $this->regex_rule = '(' . $chars[0]; |
| 77 | - foreach($chars as $char) |
|
| 77 | + foreach ($chars as $char) |
|
| 78 | 78 | { |
| 79 | 79 | $this->regex_rule .= '|' . $char; |
| 80 | 80 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $bot = new WhoAmIBot('BOT_TOKEN'); |
| 29 | 29 | |
| 30 | 30 | // Add a welcome message |
| 31 | -$bot->addMessageCommand('start', function ($bot, $message) { |
|
| 31 | +$bot->addMessageCommand('start', function($bot, $message) { |
|
| 32 | 32 | $bot->sendMessage('<strong>Hey there!</strong> Send or forward me a text message :)'); |
| 33 | 33 | } |
| 34 | 34 | ); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $bot = new DonateBot('BOT_TOKEN'); |
| 23 | 23 | $bot->setPayment('PROVIDER_TOKEN', 'EUR'); |
| 24 | 24 | |
| 25 | -$bot->addMessageCommand('start', function ($bot, $message) { |
|
| 25 | +$bot->addMessageCommand('start', function($bot, $message) { |
|
| 26 | 26 | $bot->sendInvoice('Donation', 'Small donation', 'don1', array('Donation' => 2)); |
| 27 | 27 | $bot->sendInvoice('Donation', 'Medium donation', 'don2', array('Donation' => 5)); |
| 28 | 28 | $bot->sendInvoice('Donation', 'Large donation', 'don3', array('Donation' => 10)); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function addResult(array $result) : int |
| 129 | 129 | { |
| 130 | - if (array_key_exists('type', $result) && ! in_array($result['type'], $this->accepted_type)) { |
|
| 130 | + if (array_key_exists('type', $result) && !in_array($result['type'], $this->accepted_type)) { |
|
| 131 | 131 | throw new BotException("Result has wrong or no type at all. Check that the result has a value of key 'type' that correspond to a type in the API Reference"); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | 'disable_web_page_preview' => $disable_web_preview |
| 172 | 172 | ]); |
| 173 | 173 | |
| 174 | - if ( is_null($reply_markup) ) { |
|
| 175 | - unset( $this->results[ $this->id_result ]['reply_markup'] ); |
|
| 174 | + if (is_null($reply_markup)) { |
|
| 175 | + unset($this->results[$this->id_result]['reply_markup']); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | return $this->id_result++; |