Skip to content

Commit 7733775

Browse files
committed
update to 0.5.10, fix workerman log problem
1 parent 1e07205 commit 7733775

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
'blank_line_between_import_groups' => false,
7373
'phpdoc_order' => ['order' => ['param', 'throws', 'return']],
7474
'php_unit_test_class_requires_covers' => false,
75+
'no_null_property_initialization' => false,
7576
])
7677
->setFinder(
7778
PhpCsFixer\Finder::create()

src/OneBot/Driver/Event/StopException.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,16 @@
66

77
class StopException extends \Exception
88
{
9+
private DriverEvent $event;
10+
11+
public function __construct(DriverEvent $event, $message = '', $code = 0, \Throwable $previous = null)
12+
{
13+
$this->event = $event;
14+
parent::__construct($message, $code, $previous);
15+
}
16+
17+
public function getEvent(): DriverEvent
18+
{
19+
return $this->event;
20+
}
921
}

src/OneBot/V12/Object/ActionResponse.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ class ActionResponse implements \JsonSerializable, \IteratorAggregate
2020

2121
public string $message = '';
2222

23+
/**
24+
* @var mixed
25+
*/
26+
public $echo = null;
27+
2328
public static function create($echo = null): ActionResponse
2429
{
2530
$a = new self();
@@ -55,13 +60,16 @@ public function fail($retcode, $message = ''): ActionResponse
5560
#[\ReturnTypeWillChange]
5661
public function getIterator(): \ArrayIterator
5762
{
58-
return new \ArrayIterator($this);
63+
return new \ArrayIterator($this->jsonSerialize());
5964
}
6065

6166
public function jsonSerialize(): array
6267
{
6368
$data = [];
6469
foreach ($this as $k => $v) {
70+
if ($k === 'echo' && $v === null) {
71+
continue;
72+
}
6573
$data[$k] = $v;
6674
}
6775
return $data;

src/OneBot/global_defines.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use ZM\Logger\ConsoleLogger;
1414

1515
const ONEBOT_VERSION = '12';
16-
const ONEBOT_LIBOB_VERSION = '0.5.9';
16+
const ONEBOT_LIBOB_VERSION = '0.5.10';
1717

1818
const ONEBOT_JSON = 1;
1919
const ONEBOT_MSGPACK = 2;

0 commit comments

Comments
 (0)