1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 05:14:39 +01:00
This commit is contained in:
Daniil Gentili 2017-08-14 20:42:58 +02:00
parent f16aa7c63a
commit 5e7babfa76
2 changed files with 10 additions and 2 deletions

View File

@ -157,8 +157,8 @@ class Lua
array_walk_recursive($data, function (&$value, $key) {
if (is_object($value)) {
$newval = [];
foreach (get_class_methods($value) as $key => $name) {
$newval[$key] = [$value, $name];
if (method_exists($value, 'click')) {
$newval['click'] = [$value, 'click'];
}
foreach ($value as $key => $name) {
$newval[$key] = $name;

View File

@ -42,6 +42,14 @@ class Button extends \Volatile implements \JsonSerializable
}
}
public function __debugInfo() {
return [
'data' => $this->data,
'info' => ['peer' => $this->info['peer'], 'id' => $this->info['id']]
];
}
public function jsonSerialize()
{
return (array) $this->data;