Minor improvements (#787)

This commit is contained in:
Roman Kelesidis 2023-06-07 15:51:27 +07:00 committed by GitHub
commit 0a72b27a09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 3 deletions

View file

@ -10,9 +10,11 @@
namespace TorrentPier;
use Closure;
use Dotenv\Repository\Adapter\PutenvAdapter;
use Dotenv\Repository\RepositoryBuilder;
use Dotenv\Repository\RepositoryInterface;
use PhpOption\Option;
/**

View file

@ -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 . "

View file

@ -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
*/

View file

@ -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;