Skip to content

Commit 59faa33

Browse files
committed
Code style fixes
1 parent af6f4df commit 59faa33

File tree

8 files changed

+225
-409
lines changed

8 files changed

+225
-409
lines changed

composer.lock

Lines changed: 214 additions & 397 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Commands/AdminCommands/ChatsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function execute()
5454

5555
foreach ($results as $result) {
5656
//Initialize a chat object
57-
$result['id'] = $result['chat_id'];
57+
$result['id'] = $result['chat_id'];
5858
$chat = new Chat($result);
5959

6060
if ($chat->isPrivateChat()) {

src/ConversationDB.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public static function update($table, array $fields_values, array $where_fields_
171171
$where .= 'WHERE ';
172172
}
173173
++$tokens_counter;
174-
$where .= '`' . $field .'`= :' . $tokens_counter ;
174+
$where .= '`' . $field .'`= :' . $tokens_counter;
175175
$tokens[':' . $tokens_counter] = $value;
176176
}
177177

src/DB.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static function selectTelegramUpdate($limit = null)
147147
$query .= 'ORDER BY `id` DESC';
148148

149149
if (!is_null($limit)) {
150-
$query .=' LIMIT :limit ';
150+
$query .= ' LIMIT :limit ';
151151
}
152152

153153
$sth_select_telegram_update = self::$pdo->prepare($query);
@@ -182,7 +182,7 @@ public static function selectMessages($limit = null)
182182
$query .= 'ORDER BY ' . TB_MESSAGE . '.`message_id` DESC';
183183

184184
if (!is_null($limit)) {
185-
$query .=' LIMIT :limit ';
185+
$query .= ' LIMIT :limit ';
186186
}
187187

188188
$sth = self::$pdo->prepare($query);
@@ -684,15 +684,15 @@ public static function selectChats(
684684

685685
if (! is_null($date_from)) {
686686
$where[] = TB_CHAT . '.`updated_at` >= :date_from';
687-
$tokens[':date_from'] = $date_from;
687+
$tokens[':date_from'] = $date_from;
688688
}
689689

690690
if (! is_null($date_to)) {
691691
$where[] = TB_CHAT . '.`updated_at` <= :date_to';
692692
$tokens[':date_to'] = $date_to;
693693
}
694694

695-
$a=0;
695+
$a = 0;
696696
foreach ($where as $part) {
697697
if ($a) {
698698
$query .= ' AND ' . $part;

src/Entities/Chat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(array $data)
4949

5050
public function isGroupChat()
5151
{
52-
if ($this->type == 'group' || $this->id < 0) {
52+
if ($this->type == 'group' || $this->id < 0) {
5353
return true;
5454
}
5555
return false;

src/Entities/Message.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ protected function init(array & $data, & $bot_name)
236236
public function getFullCommand()
237237
{
238238
if (substr($this->text, 0, 1) === '/') {
239-
$no_EOL = strtok($this->text, PHP_EOL);
239+
$no_EOL = strtok($this->text, PHP_EOL);
240240
$no_space = strtok($this->text, ' ');
241241

242242
//try to understand which separator \n or space divide /command from text

src/Entities/ServerResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function __construct(array $data, $bot_name)
9999
//must be an array
100100
protected function isAssoc(array $array)
101101
{
102-
return (bool)count(array_filter(array_keys($array), 'is_string'));
102+
return (bool) count(array_filter(array_keys($array), 'is_string'));
103103
}
104104
public function isOk()
105105
{

src/Request.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,8 @@ public static function executeCurl($action, array $data = null)
208208

209209
//Logging getUpdates Update
210210
//Logging curl updates
211-
if ($action == 'getUpdates'
212-
& self::$telegram->getLogVerbosity() >=1
213-
| self::$telegram->getLogVerbosity() >=3) {
211+
if ($action == 'getUpdates' & self::$telegram->getLogVerbosity() >= 1 | self::$telegram->getLogVerbosity() >= 3
212+
) {
214213
self::setInputRaw($result);
215214
self::log($result);
216215
}

0 commit comments

Comments
 (0)