mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 03:14:39 +01:00
Fixes to logger updateSettings, getReply and FilterReplyToSelf.
This commit is contained in:
parent
82eeeae7bf
commit
937f67102a
@ -119,7 +119,7 @@ abstract class AbstractMessage extends Update implements SimpleFilters
|
||||
*/
|
||||
public function getReply(string $class = AbstractMessage::class): ?self
|
||||
{
|
||||
if (!\is_subclass_of($class, AbstractMessage::class)) {
|
||||
if ($class !== AbstractMessage::class && !\is_subclass_of($class, AbstractMessage::class)) {
|
||||
throw new AssertionError("A class that extends AbstractMessage was expected.");
|
||||
}
|
||||
if ($this->replyToMsgId === null) {
|
||||
|
@ -14,6 +14,6 @@ final class FilterReplyToSelf extends Filter
|
||||
{
|
||||
public function apply(Update $update): bool
|
||||
{
|
||||
return $update instanceof Message && $update->getReply()->out;
|
||||
return $update instanceof Message && $update->getReply()?->out;
|
||||
}
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ final class Logger extends SettingsAbstract
|
||||
public function __sleep()
|
||||
{
|
||||
return $this->extra instanceof Closure
|
||||
? ['type', 'extra', 'level', 'maxSize']
|
||||
: ['type', 'level', 'maxSize'];
|
||||
? ['type', 'level', 'maxSize']
|
||||
: ['type', 'extra', 'level', 'maxSize'];
|
||||
}
|
||||
/**
|
||||
* Wakeup function.
|
||||
|
Loading…
Reference in New Issue
Block a user