From 5e7babfa76770fa46cf3864a51e084db0af4659c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 14 Aug 2017 20:42:58 +0200 Subject: [PATCH] fixes --- src/danog/MadelineProto/Lua.php | 4 ++-- src/danog/MadelineProto/TL/Types/Button.php | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/Lua.php b/src/danog/MadelineProto/Lua.php index c0de88ff4..06c15a272 100644 --- a/src/danog/MadelineProto/Lua.php +++ b/src/danog/MadelineProto/Lua.php @@ -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; diff --git a/src/danog/MadelineProto/TL/Types/Button.php b/src/danog/MadelineProto/TL/Types/Button.php index ac7e6ea2d..e4dc8bdb8 100644 --- a/src/danog/MadelineProto/TL/Types/Button.php +++ b/src/danog/MadelineProto/TL/Types/Button.php @@ -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;