@@ -64,11 +64,9 @@ discard block |
||
| 64 | 64 | foreach ($settings as $setting => $value) {
|
| 65 | 65 | try{
|
| 66 | 66 | self::$$setting = $value; |
| 67 | - } |
|
| 68 | - catch (TypeError){
|
|
| 67 | + } catch (TypeError){
|
|
| 69 | 68 | logger::write("$setting setting has wrong type , its set to default value",'warning');
|
| 70 | - } |
|
| 71 | - catch (Error){
|
|
| 69 | + } catch (Error){
|
|
| 72 | 70 | logger::write("$setting setting is not one of library settings",'warning');
|
| 73 | 71 | } |
| 74 | 72 | } |
@@ -79,12 +77,10 @@ discard block |
||
| 79 | 77 | self::secureFolder(); |
| 80 | 78 | self::db(); |
| 81 | 79 | self::$receiver !== receiver::GETUPDATES ? self::webhook() : self::getUpdates(); |
| 82 | - } |
|
| 83 | - else {
|
|
| 80 | + } else {
|
|
| 84 | 81 | logger::write('token format is not right, check it and try again','error');
|
| 85 | 82 | } |
| 86 | - } |
|
| 87 | - else {
|
|
| 83 | + } else {
|
|
| 88 | 84 | logger::write('You must specify token parameter in settings','error');
|
| 89 | 85 | } |
| 90 | 86 | } |
@@ -125,8 +121,7 @@ discard block |
||
| 125 | 121 | private static function getUpdates() {
|
| 126 | 122 | if (self::$handler) {
|
| 127 | 123 | getUpdates::init(); |
| 128 | - } |
|
| 129 | - else {
|
|
| 124 | + } else {
|
|
| 130 | 125 | logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler','error');
|
| 131 | 126 | } |
| 132 | 127 | } |
@@ -230,8 +230,7 @@ discard block |
||
| 230 | 230 | self::keysName($action,$arguments); |
| 231 | 231 | self::readyFile($action,$arguments); |
| 232 | 232 | print_r($arguments); |
| 233 | - } |
|
| 234 | - else {
|
|
| 233 | + } else {
|
|
| 235 | 234 | logger::write("$name method is not supported",'error');
|
| 236 | 235 | } |
| 237 | 236 | } |
@@ -256,8 +255,7 @@ discard block |
||
| 256 | 255 | $arguments['media'][$key]['media'] = new CURLFile($media['media']); |
| 257 | 256 | } |
| 258 | 257 | } |
| 259 | - } |
|
| 260 | - elseif ($file_params = self::methodFile($name)) {
|
|
| 258 | + } elseif ($file_params = self::methodFile($name)) {
|
|
| 261 | 259 | foreach ($file_params as $param) {
|
| 262 | 260 | if (isset($arguments[$param]) && file_exists($arguments[$param])) {
|
| 263 | 261 | $arguments[$param] = new CURLFile($arguments[$param]); |
@@ -6,8 +6,7 @@ discard block |
||
| 6 | 6 | public function __call (string $name, array $arguments) {
|
| 7 | 7 | if (!isset($arguments[1]) && is_array($arguments[0])) {
|
| 8 | 8 | request::$name(...$arguments[0]); |
| 9 | - } |
|
| 10 | - else {
|
|
| 9 | + } else {
|
|
| 11 | 10 | request::$name($arguments); |
| 12 | 11 | } |
| 13 | 12 | } |
@@ -15,8 +14,7 @@ discard block |
||
| 15 | 14 | public static function __callStatic (string $name, array $arguments) {
|
| 16 | 15 | if (!isset($arguments[1]) && is_array($arguments[0])) {
|
| 17 | 16 | request::$name(...$arguments[0]); |
| 18 | - } |
|
| 19 | - else {
|
|
| 17 | + } else {
|
|
| 20 | 18 | request::$name(...$arguments); |
| 21 | 19 | } |
| 22 | 20 | } |
@@ -13,8 +13,7 @@ |
||
| 13 | 13 | if (file_exists('BPT.log') && !(filesize('BPT.log') > self::$log_size * 1024 * 1024)) {
|
| 14 | 14 | $mode = 'a'; |
| 15 | 15 | $write = false; |
| 16 | - } |
|
| 17 | - else {
|
|
| 16 | + } else {
|
|
| 18 | 17 | $mode = 'w'; |
| 19 | 18 | $write = true; |
| 20 | 19 | } |
@@ -17,8 +17,7 @@ |
||
| 17 | 17 | public function __call (string $name, array $arguments) {
|
| 18 | 18 | if (!isset($arguments[1]) && is_array($arguments[0])) {
|
| 19 | 19 | request::$name(...$arguments[0]); |
| 20 | - } |
|
| 21 | - else {
|
|
| 20 | + } else {
|
|
| 22 | 21 | request::$name($arguments); |
| 23 | 22 | } |
| 24 | 23 | } |
@@ -17,8 +17,7 @@ |
||
| 17 | 17 | foreach ($update as $key=>$value) { |
| 18 | 18 | if (isset($subs[$key])) { |
| 19 | 19 | $this->$key = new ($subs[$key]) ($value); |
| 20 | - } |
|
| 21 | - else { |
|
| 20 | + } else { |
|
| 22 | 21 | $this->$key = $value; |
| 23 | 22 | if (ucfirst($key) === basename(get_class($this)).'_id') { |
| 24 | 23 | $this->{'id'} = $value; |
@@ -214,14 +214,14 @@ |
||
| 214 | 214 | curl_exec($ch); |
| 215 | 215 | $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); |
| 216 | 216 | curl_close($ch); |
| 217 | - } |
|
| 218 | - else {
|
|
| 217 | + } else {
|
|
| 219 | 218 | $size = file_exists($path) ? filesize($path) : false; |
| 220 | 219 | } |
| 221 | 220 | |
| 222 | 221 | if (isset($size) && is_numeric($size)) {
|
| 223 | 222 | return $format ? tools::rateConverter($size) : $size; |
| 224 | - } |
|
| 225 | - else return false; |
|
| 223 | + } else { |
|
| 224 | + return false; |
|
| 225 | + } |
|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | \ No newline at end of file |