Skip to content

Commit 7529fc4

Browse files
authored
Merge branch 'develop' into 955-bot_api_4.3
2 parents 0904162 + 89af4d4 commit 7529fc4

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
88
- Bot API 4.3 (Seamless Telegram Login, `LoginUrl`)
99
- `reply_markup` field to `Message` entity.
1010
### Changed
11+
- Use PSR-12 for code style.
1112
### Deprecated
1213
### Removed
1314
### Fixed
15+
- `forward_date` is now correctly saved to the DB.
1416
### Security
1517

1618
## [0.57.0] - 2019-06-01

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"scripts": {
4949
"check-code": [
50-
"\"vendor/bin/phpcs\" --standard=phpcs.xml -snp --encoding=utf-8 src/ tests/ --report-width=150"
50+
"\"vendor/bin/phpcs\" --standard=phpcs.xml -snp src/ tests/"
5151
],
5252
"test": [
5353
"\"vendor/bin/phpunit\""

Diff for: phpcs.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
<description>PHP Code Sniffer</description>
44

55
<arg name="colors"/>
6+
<arg name="parallel" value="8"/>
7+
<arg name="encoding" value="utf-8"/>
8+
<arg name="report-width" value="150"/>
69

7-
<rule ref="PSR2"/>
10+
<rule ref="PSR12"/>
811

912
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
1013
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>

Diff for: src/DB.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -881,18 +881,17 @@ public static function insertMessageRequest(Message $message)
881881
}
882882

883883
// Insert the forwarded message user in users table
884-
$forward_date = null;
884+
$forward_date = $message->getForwardDate() ? self::getTimestamp($message->getForwardDate()) : null;
885+
885886
$forward_from = $message->getForwardFrom();
886887
if ($forward_from instanceof User) {
887-
self::insertUser($forward_from, $forward_date);
888+
self::insertUser($forward_from);
888889
$forward_from = $forward_from->getId();
889-
$forward_date = self::getTimestamp($message->getForwardDate());
890890
}
891891
$forward_from_chat = $message->getForwardFromChat();
892892
if ($forward_from_chat instanceof Chat) {
893-
self::insertChat($forward_from_chat, $forward_date);
893+
self::insertChat($forward_from_chat);
894894
$forward_from_chat = $forward_from_chat->getId();
895-
$forward_date = self::getTimestamp($message->getForwardDate());
896895
}
897896

898897
// New and left chat member

Diff for: tests/unit/Commands/CommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function testCommandConstructorNeedsTelegramObject()
7474
[null],
7575
[12345],
7676
['something'],
77-
[new \stdClass],
77+
[new \stdClass()],
7878
[$this->telegram], // only this one is valid
7979
];
8080

0 commit comments

Comments
 (0)