From 2de13593675382ec3f8ee112fc513b1bddc70fc6 Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Sun, 1 Nov 2020 23:01:58 +0300 Subject: [PATCH] Fix types in settings --- config.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config.php b/config.php index 145d5ae..a693f85 100644 --- a/config.php +++ b/config.php @@ -2,18 +2,18 @@ $settings = [ 'server' => [ - 'address' => (string)getenv('SERVER_ADDRESS'), - 'port' => (string)getenv('SERVER_PORT'), + 'address' => (string) getenv('SERVER_ADDRESS'), + 'port' => (int) getenv('SERVER_PORT'), ], 'telegram' => [ 'app_info' => [ // obtained in https://my.telegram.org - 'api_id' => getenv('TELEGRAM_API_ID'), - 'api_hash' => getenv('TELEGRAM_API_HASH'), + 'api_id' => (int) getenv('TELEGRAM_API_ID'), + 'api_hash' => (string) getenv('TELEGRAM_API_HASH'), ], 'logger' => [ // Logger settings 'logger' => \danog\MadelineProto\Logger::CALLABLE_LOGGER, // 0 - Logs disabled, 3 - echo logs. 'logger_param' => \TelegramApiServer\EventObservers\LogObserver::class . '::log', - 'logger_level' => getenv('LOGGER_LEVEL'), // Logging level, available logging levels are: ULTRA_VERBOSE - 5, VERBOSE - 4 , NOTICE - 3, WARNING - 2, ERROR - 1, FATAL_ERROR - 0. + 'logger_level' => (int) getenv('LOGGER_LEVEL'), // Logging level, available logging levels are: ULTRA_VERBOSE - 5, VERBOSE - 4 , NOTICE - 3, WARNING - 2, ERROR - 1, FATAL_ERROR - 0. ], 'updates' => [ 'handle_updates' => true, // Should I handle updates? @@ -23,8 +23,8 @@ $settings = [ 'all' => [ 'proxy' => '\SocksProxy', 'proxy_extra' => [ - 'address' => getenv('TELEGRAM_PROXY_ADDRESS'), - 'port' => getenv('TELEGRAM_PROXY_PORT'), + 'address' => (string) getenv('TELEGRAM_PROXY_ADDRESS'), + 'port' => (int) getenv('TELEGRAM_PROXY_PORT'), 'username' => getenv('TELEGRAM_PROXY_USERNAME'), 'password' => getenv('TELEGRAM_PROXY_PASSWORD'), ] @@ -37,7 +37,7 @@ $settings = [ 'db' => [ 'type' => getenv('DB_TYPE'), getenv('DB_TYPE') => [ - 'host' => getenv('DB_HOST'), + 'host' => (string) getenv('DB_HOST'), 'port' => (int) getenv('DB_PORT'), 'user' => getenv('DB_USER'), 'password' => getenv('DB_PASSWORD'),