[PHP 8.4] Fixed some deprecations (#1718)

* [PHP 8.4] Fixed some deprecations

* Update Post.php

* Update Common.php

* Update CHANGELOG.md

* Updated

* Updated
This commit is contained in:
Roman Kelesidis 2024-12-19 00:37:28 +07:00 committed by GitHub
commit 8a0cd5cb84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 156 additions and 667 deletions

View file

@ -7,6 +7,7 @@
- Release 2.4.5 🍧️ ([belomaxorka](https://github.com/belomaxorka))
- Show torrent's announcers list in `filelist.php` page [\#1708](https://github.com/torrentpier/torrentpier/pull/1708) ([belomaxorka](https://github.com/belomaxorka))
- [PHP 8.4] Fixed some deprecations [\#1718](https://github.com/torrentpier/torrentpier/pull/1718) ([belomaxorka](https://github.com/belomaxorka))
- [Configurable] Show magnet-links for guests [\#1712](https://github.com/torrentpier/torrentpier/pull/1712) ([belomaxorka](https://github.com/belomaxorka))
- Set `cursor: pointer;` for buttons, inputs (buttons) [\#1710](https://github.com/torrentpier/torrentpier/pull/1710), [\#1711](https://github.com/torrentpier/torrentpier/pull/1711) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1705](https://github.com/torrentpier/torrentpier/pull/1705), [\#1713](https://github.com/torrentpier/torrentpier/pull/1713), [\#1715](https://github.com/torrentpier/torrentpier/pull/1715), [\#1717](https://github.com/torrentpier/torrentpier/pull/1717) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -63,7 +63,7 @@
"php-curl-class/php-curl-class": "^11.0.0",
"league/flysystem": "^3.28",
"longman/ip-tools": "1.2.1",
"matthiasmullie/scrapbook": "^1.5",
"matthiasmullie/scrapbook": "dev-master",
"monolog/monolog": "^3.4",
"samdark/sitemap": "2.4.1",
"symfony/finder": "^6.4",
@ -71,6 +71,7 @@
"symfony/event-dispatcher": "^6.4",
"symfony/mime": "^6.4",
"symfony/mailer": "^6.4",
"symfony/polyfill": "v1.31.0",
"vlucas/phpdotenv": "^5.5"
},
"require-dev": {

807
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -2126,7 +2126,7 @@ function user_birthday_icon($user_birthday, $user_id): string
* @param int|null $userId
* @return array|null
*/
function getBanInfo(int $userId = null): ?array
function getBanInfo(?int $userId = null): ?array
{
global $datastore;

View file

@ -432,7 +432,7 @@ class Common
* @param string $reason_move
* @return bool
*/
public static function topic_move(int|array|string $topic_id, int|string $to_forum_id, int|string $from_forum_id = null, bool $leave_shadow = false, bool $insert_bot_msg = false, string $reason_move = ''): bool
public static function topic_move(int|array|string $topic_id, int|string $to_forum_id, null|int|string $from_forum_id = null, bool $leave_shadow = false, bool $insert_bot_msg = false, string $reason_move = ''): bool
{
global $log_action;

View file

@ -54,7 +54,7 @@ class Common
* @param string|null $name
* @return bool
*/
public function rm(string $name = null): bool
public function rm(?string $name = null): bool
{
return false;
}

View file

@ -116,7 +116,7 @@ class File extends Common
* @param string|null $name
* @return bool
*/
public function rm(string $name = null): bool
public function rm(?string $name = null): bool
{
$targetMethod = is_string($name) ? 'delete' : 'flush';
$name = is_string($name) ? $this->prefix . $name : null;

View file

@ -422,10 +422,10 @@ class Post
* @param int|string|null $old_forum_id
* @param int|string|null $new_topic_id
* @param string $new_topic_title
* @param int|null $old_topic_id
* @param int|string|null $old_topic_id
* @param string $reason_move
*/
public static function insert_post(string $mode, int|string $topic_id, int|string $forum_id = null, int|string $old_forum_id = null, int|string $new_topic_id = null, string $new_topic_title = '', int $old_topic_id = null, string $reason_move = ''): void
public static function insert_post(string $mode, int|string $topic_id, null|int|string $forum_id = null, null|int|string $old_forum_id = null, null|int|string $new_topic_id = null, string $new_topic_title = '', null|int|string $old_topic_id = null, string $reason_move = ''): void
{
global $userdata, $lang;