From 10e5346ae8dc5ca66496c9c55985bb81eaafe920 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 27 Apr 2017 09:59:40 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/danog/MadelineProto/Exception.php | 4 +++- src/danog/MadelineProto/TL/TL.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/Exception.php b/src/danog/MadelineProto/Exception.php index b4aad0c1..6da0aefe 100644 --- a/src/danog/MadelineProto/Exception.php +++ b/src/danog/MadelineProto/Exception.php @@ -26,7 +26,9 @@ class Exception extends \Exception if ($file !== null) { $this->file = $file; } - if (in_array($message, ['Re-executing query...', 'I had to recreate the temporary authorization key', 'This peer is not present in the internal peer database', "Couldn't get response"])) return; + if (in_array($message, ['Re-executing query...', 'I had to recreate the temporary authorization key', 'This peer is not present in the internal peer database', "Couldn't get response"])) { + return; + } \Rollbar\Rollbar::log($this, debug_backtrace(), 'error'); } diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 8b8e3f28..15ed8e1e 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -310,7 +310,9 @@ trait TL if ((!is_array($object) || (isset($object['_']) && $this->constructors->find_by_predicate($object['_'])['type'] !== $type['type'])) && in_array($type['type'], ['User', 'InputUser', 'Chat', 'InputChannel', 'Peer', 'InputPeer'])) { $object = $this->get_info($object); - if (!isset($object[$type['type']])) throw new \danog\MadelineProto\Exception("This peer is not present in the internal peer database"); + if (!isset($object[$type['type']])) { + throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database'); + } $object = $object[$type['type']]; } if (!isset($object['_'])) {