@@ -862,20 +862,17 @@ discard block |
||
862 | 862 | foreach ($arguments['media'] as $key => $media) { |
863 | 863 | if ($media['media'] instanceof CURLFile) { |
864 | 864 | $remove_answer = true; |
865 | - } |
|
866 | - elseif (is_string($media['media']) && file_exists(realpath($media['media']))) { |
|
865 | + } elseif (is_string($media['media']) && file_exists(realpath($media['media']))) { |
|
867 | 866 | $arguments['media'][$key]['media'] = new CURLFile($media['media']); |
868 | 867 | $remove_answer = true; |
869 | 868 | } |
870 | 869 | } |
871 | - } |
|
872 | - elseif ($file_params = self::methodFile($name)) { |
|
870 | + } elseif ($file_params = self::methodFile($name)) { |
|
873 | 871 | foreach ($file_params as $param) { |
874 | 872 | if (isset($arguments[$param])) { |
875 | 873 | if ($arguments[$param] instanceof CURLFile) { |
876 | 874 | $remove_answer = true; |
877 | - } |
|
878 | - elseif (is_string($arguments[$param]) && file_exists(realpath($arguments[$param]))) { |
|
875 | + } elseif (is_string($arguments[$param]) && file_exists(realpath($arguments[$param]))) { |
|
879 | 876 | $arguments[$param] = new CURLFile($arguments[$param]); |
880 | 877 | $remove_answer = true; |
881 | 878 | } |
@@ -915,8 +912,7 @@ discard block |
||
915 | 912 | if (!isset($arguments[$default])){ |
916 | 913 | $arguments[$default] = self::catchFields($default); |
917 | 914 | } |
918 | - } |
|
919 | - elseif (isset(BPT::$update->$key) || $key === 'other') { |
|
915 | + } elseif (isset(BPT::$update->$key) || $key === 'other') { |
|
920 | 916 | foreach ($default as $def) { |
921 | 917 | if (!isset($arguments[$def])){ |
922 | 918 | $arguments[$def] = self::catchFields($def); |
@@ -987,9 +983,13 @@ discard block |
||
987 | 983 | default => false |
988 | 984 | }; |
989 | 985 | case fields::FILE_ID : |
990 | - if (isset(BPT::$update->message)) $type = 'message'; |
|
991 | - elseif (isset(BPT::$update->edited_message)) $type = 'edited_message'; |
|
992 | - else return false; |
|
986 | + if (isset(BPT::$update->message)) { |
|
987 | + $type = 'message'; |
|
988 | + } elseif (isset(BPT::$update->edited_message)) { |
|
989 | + $type = 'edited_message'; |
|
990 | + } else { |
|
991 | + return false; |
|
992 | + } |
|
993 | 993 | |
994 | 994 | return match(true) { |
995 | 995 | isset(BPT::$update->$type->animation) => BPT::$update->$type->animation->file_id, |