Skip to content

Commit fb1c091

Browse files
committed
* Merge branch 'master' of github.com:onPHP/onphp-framework
2 parents 8485d51 + f95c677 commit fb1c091

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

doc/ChangeLog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2011-11-18 Evgeny V. Kokovikhin
2+
3+
* main/Messages/TextMessage.class.php, main/Messages/TextFileReceiver.class.php:
4+
a bit optimize: don't needed to make Timestamp twice
5+
16
2011-11-17 Sergey S. Sergeev
27

38
* main/Base/LightMetaProperty.class.php: speed up insert or update operations,
@@ -6,7 +11,7 @@
611
2011-11-14 Dmitry V. Snezhinskiy
712

813
* main/Utils/AMQP/Pecl/AMQPPeclChannel.class.php :
9-
customize AMQPPeclChannel Exception. Author Evgenia T. Tekalin
14+
customize AMQPPeclChannel Exception. Author Evgenia T. Tekalin.
1015

1116
2011-11-14 Evgeny V. Kokovikhin
1217

main/Messages/TextFileReceiver.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ public function receive($uTimeout = null)
6969

7070
Assert::isNotNull($time);
7171

72-
$result = TextMessage::create()->
73-
setTimestamp(Timestamp::create($time))->
72+
$result = TextMessage::create(Timestamp::create($time))->
7473
setText($text);
7574

7675
return $result;

main/Messages/TextMessage.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ final class TextMessage implements Message
1515
private $timestamp = null;
1616
private $text = null;
1717

18-
public static function create()
18+
public static function create(Timestamp $timestamp = null)
1919
{
20-
return new self;
20+
return new self($timestamp);
2121
}
2222

23-
public function __construct()
23+
public function __construct(Timestamp $timestamp = null)
2424
{
25-
$this->timestamp = Timestamp::makeNow();
25+
$this->timestamp = $timestamp ?: Timestamp::makeNow();
2626
}
2727

28-
public function setTimestamp($timestamp)
28+
public function setTimestamp(Timestamp $timestamp)
2929
{
3030
$this->timestamp = $timestamp;
3131

0 commit comments

Comments
 (0)