@@ -217,15 +217,15 @@ |
||
| 217 | 217 | * @method getGameHighScores (int|null $user_id = null, int|null $chat_id = null, int|null $message_id = null, string|null $inline_message_id = null, string|null $token = null, bool|null $return_array = null, bool|null $forgot = null, bool|null $answer = null) Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. |
| 218 | 218 | * @method getGameHigh (int|null $user_id = null, int|null $chat_id = null, int|null $message_id = null, string|null $inline_message_id = null, string|null $token = null, bool|null $return_array = null, bool|null $forgot = null, bool|null $answer = null) Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. |
| 219 | 219 | */ |
| 220 | -class BPT{
|
|
| 220 | +class BPT {
|
|
| 221 | 221 | public update $update; |
| 222 | 222 | |
| 223 | 223 | |
| 224 | - public function __construct (array|stdClass $settings) {
|
|
| 224 | + public function __construct(array | stdClass $settings) {
|
|
| 225 | 225 | settings::init($settings); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - public function __call (string $name, array $arguments) {
|
|
| 228 | + public function __call(string $name, array $arguments) {
|
|
| 229 | 229 | if (!isset($arguments[1]) && is_array($arguments[0])) {
|
| 230 | 230 | request::$name(...$arguments[0]); |
| 231 | 231 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | * @method static getGameHigh (int|null $user_id = null, int|null $chat_id = null, int|null $message_id = null, string|null $inline_message_id = null, string|null $token = null, bool|null $return_array = null, bool|null $forgot = null, bool|null $answer = null) Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. |
| 215 | 215 | */ |
| 216 | 216 | class telegram {
|
| 217 | - public function __call (string $name, array $arguments) {
|
|
| 217 | + public function __call(string $name, array $arguments) {
|
|
| 218 | 218 | if (!isset($arguments[1]) && is_array($arguments[0])) {
|
| 219 | 219 | request::$name(...$arguments[0]); |
| 220 | 220 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - public static function __callStatic (string $name, array $arguments) {
|
|
| 226 | + public static function __callStatic(string $name, array $arguments) {
|
|
| 227 | 227 | if (!isset($arguments[1]) && is_array($arguments[0])) {
|
| 228 | 228 | request::$name(...$arguments[0]); |
| 229 | 229 | } |
@@ -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 | } |
@@ -225,18 +225,18 @@ discard block |
||
| 225 | 225 | ]; |
| 226 | 226 | |
| 227 | 227 | |
| 228 | - public static function __callStatic (string $name, array $arguments) {
|
|
| 228 | + public static function __callStatic(string $name, array $arguments) {
|
|
| 229 | 229 | if ($action = self::methodAction($name)) {
|
| 230 | - self::keysName($action,$arguments); |
|
| 231 | - self::readyFile($action,$arguments); |
|
| 230 | + self::keysName($action, $arguments); |
|
| 231 | + self::readyFile($action, $arguments); |
|
| 232 | 232 | print_r($arguments); |
| 233 | 233 | } |
| 234 | 234 | else {
|
| 235 | - logger::write("$name method is not supported",'error');
|
|
| 235 | + logger::write("$name method is not supported", 'error');
|
|
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - private static function keysName (string $name, array &$arguments) {
|
|
| 239 | + private static function keysName(string $name, array &$arguments) {
|
|
| 240 | 240 | foreach ($arguments as $key => $argument) {
|
| 241 | 241 | if (is_numeric($key) && isset(self::METHODS_KEYS[$name][$key])) {
|
| 242 | 242 | $arguments[self::METHODS_KEYS[$name][$key]] = $argument; |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - private static function methodAction(string $name): string|false {
|
|
| 248 | + private static function methodAction(string $name): string | false {
|
|
| 249 | 249 | return self::METHODS_ACTION[strtolower($name)] ?? false; |
| 250 | 250 | } |
| 251 | 251 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - private static function methodFile(string $name): array|false {
|
|
| 269 | + private static function methodFile(string $name): array | false {
|
|
| 270 | 270 | return self::METHODS_WITH_FILE[$name] ?? false; |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | \ No newline at end of file |
@@ -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]); |