From 0a72b27a091f34a15b0948c3fddc8873717d89c8 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 7 Jun 2023 15:51:27 +0700 Subject: [PATCH] Minor improvements (#787) --- src/Env.php | 2 ++ src/Legacy/Common/User.php | 4 ++-- src/Legacy/LogAction.php | 9 +++++++++ src/Legacy/TorrentFileList.php | 10 +++++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Env.php b/src/Env.php index 22de04735..65165256e 100644 --- a/src/Env.php +++ b/src/Env.php @@ -10,9 +10,11 @@ namespace TorrentPier; use Closure; + use Dotenv\Repository\Adapter\PutenvAdapter; use Dotenv\Repository\RepositoryBuilder; use Dotenv\Repository\RepositoryInterface; + use PhpOption\Option; /** diff --git a/src/Legacy/Common/User.php b/src/Legacy/Common/User.php index 47d76d3b5..c0d6fd01b 100644 --- a/src/Legacy/Common/User.php +++ b/src/Legacy/Common/User.php @@ -229,7 +229,7 @@ class User * * @return array */ - public function session_create($userdata, $auto_created = false) + public function session_create($userdata, bool $auto_created = false): array { global $bb_cfg, $lang; @@ -334,7 +334,7 @@ class User * @param bool $update_lastvisit * @param bool $set_cookie */ - public function session_end($update_lastvisit = false, $set_cookie = true) + public function session_end(bool $update_lastvisit = false, bool $set_cookie = true) { DB()->query(" DELETE FROM " . BB_SESSIONS . " diff --git a/src/Legacy/LogAction.php b/src/Legacy/LogAction.php index 3acd78e8e..1dd75458f 100644 --- a/src/Legacy/LogAction.php +++ b/src/Legacy/LogAction.php @@ -29,6 +29,11 @@ class LogAction public $log_type_select = []; public $log_disabled = false; + /** + * Init + * + * @return void + */ public function init() { global $lang, $bb_cfg; @@ -39,6 +44,8 @@ class LogAction } /** + * Moderator + * * @param string $type_name * @param array $args */ @@ -88,6 +95,8 @@ class LogAction } /** + * Admin + * * @param string $type_name * @param array $args */ diff --git a/src/Legacy/TorrentFileList.php b/src/Legacy/TorrentFileList.php index 20a3581f1..c3b9d1bcc 100644 --- a/src/Legacy/TorrentFileList.php +++ b/src/Legacy/TorrentFileList.php @@ -19,10 +19,16 @@ class TorrentFileList public $files_ary = [ '/' => [] ]; + public $multiple = false; public $root_dir = ''; public $files_html = ''; + /** + * Constructor + * + * @param $decoded_file_contents + */ public function __construct($decoded_file_contents) { $this->tor_decoded = $decoded_file_contents; @@ -53,6 +59,8 @@ class TorrentFileList /** * Формирование списка файлов + * + * @return void */ private function build_filelist_array() { @@ -120,7 +128,7 @@ class TorrentFileList * @param $length * @return string */ - private function build_file_item($name, $length) + private function build_file_item($name, $length): string { global $bb_cfg, $images, $lang;