Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/Actions/Admin/ACP.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use SMF\Lang;
use SMF\Mail;
use SMF\Menu;
use SMF\PackageManager\PackageManager;
use SMF\Parser;
use SMF\Routable;
use SMF\Sapi;
Expand Down Expand Up @@ -127,7 +128,7 @@ class ACP implements ActionInterface, Routable
],
'packages' => [
'label' => 'package',
'function' => 'SMF\\PackageManager\\PackageManager::call',
'function' => PackageManager::class . '::call',
'permission' => ['admin_forum'],
'icon' => 'packages',
'subsections' => [
Expand Down
4 changes: 2 additions & 2 deletions Sources/Actions/Admin/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ public function holidays(): void
'base_href' => Config::$scripturl . '?action=admin;area=managecalendar;sa=holidays',
'default_sort_col' => 'name',
'get_items' => [
'function' => 'SMF\\Calendar\\Holiday::list',
'function' => Holiday::class . '::list',
],
'get_count' => [
'function' => 'SMF\\Calendar\\Holiday::count',
'function' => Holiday::class . '::count',
],
'no_items_label' => Lang::getTxt('holidays_no_entries', file: 'ManageCalendar'),
'columns' => [
Expand Down
7 changes: 4 additions & 3 deletions Sources/Actions/Admin/Membergroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
namespace SMF\Actions\Admin;

use SMF\ActionInterface;
use SMF\Actions\Groups;
use SMF\ActionTrait;
use SMF\Config;
use SMF\Db\DatabaseApi as Db;
Expand Down Expand Up @@ -70,7 +71,7 @@ class Membergroups implements ActionInterface
'settings' => ['settings', 'admin_forum'],

// This subaction is handled by the Groups action.
'members' => ['SMF\\Actions\\Groups::call', 'manage_membergroups'],
'members' => [Groups::class . '::call', 'manage_membergroups'],
];

/****************
Expand Down Expand Up @@ -121,7 +122,7 @@ public function index(): void
'base_href' => Config::$scripturl . '?action=admin;area=membergroups' . (isset($_REQUEST['sort2']) ? ';sort2=' . urlencode($_REQUEST['sort2']) : ''),
'default_sort_col' => 'name',
'get_items' => [
'function' => '\\SMF\\Actions\\Groups::list_getMembergroups',
'function' => Groups::class . '::list_getMembergroups',
'params' => [
'regular',
],
Expand Down Expand Up @@ -227,7 +228,7 @@ public function index(): void
'desc' => 'desc2',
],
'get_items' => [
'function' => '\\SMF\\Actions\\Groups::list_getMembergroups',
'function' => Groups::class . '::list_getMembergroups',
'params' => [
'post_count',
],
Expand Down
2 changes: 1 addition & 1 deletion Sources/Actions/Admin/PackageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
}

// Just an alias to help people looking for the package manager in the wrong namespace.
class_alias('SMF\\PackageManager\\PackageManager', 'SMF\\Actions\\Admin\\PackageManager');
class_alias(\SMF\PackageManager\PackageManager::class, 'SMF\\Actions\\Admin\\PackageManager');
3 changes: 2 additions & 1 deletion Sources/Actions/Admin/Registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use SMF\Menu;
use SMF\Profile;
use SMF\SecurityToken;
use SMF\Tasks\UpdateSpoofDetectorNames;
use SMF\Theme;
use SMF\Time;
use SMF\User;
Expand Down Expand Up @@ -635,7 +636,7 @@ public function reservedNames(): void
],
[
[
'SMF\\Tasks\\UpdateSpoofDetectorNames',
UpdateSpoofDetectorNames::class,
json_encode(['last_member_id' => 0]),
0,
],
Expand Down
5 changes: 3 additions & 2 deletions Sources/Actions/BoardIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use SMF\Cache\CacheApi;
use SMF\Category;
use SMF\Config;
use SMF\Group;
use SMF\IntegrationHook;
use SMF\Lang;
use SMF\Logging;
Expand Down Expand Up @@ -134,7 +135,7 @@ public function execute(): void
'num_days_shown' => empty(Config::$modSettings['cal_days_for_index']) || Config::$modSettings['cal_days_for_index'] < 1 ? 1 : Config::$modSettings['cal_days_for_index'],
];

Utils::$context += CacheApi::quickGet('calendar_index_offset_' . User::$me->time_offset, 'Actions/Calendar.php', 'SMF\\Actions\\Calendar::cache_getRecentEvents', [$eventOptions]);
Utils::$context += CacheApi::quickGet('calendar_index_offset_' . User::$me->time_offset, 'Actions/Calendar.php', Calendar::class . '::cache_getRecentEvents', [$eventOptions]);

// Whether one or multiple days are shown on the board index.
Utils::$context['calendar_only_today'] = Config::$modSettings['cal_days_for_index'] == 1;
Expand Down Expand Up @@ -177,7 +178,7 @@ public function execute(): void

// Are we showing all membergroups on the board index?
if (!empty(Theme::$current->settings['show_group_key'])) {
Utils::$context['membergroups'] = CacheApi::quickGet('membergroup_list', 'Group.php', 'SMF\\Group::getCachedList', []);
Utils::$context['membergroups'] = CacheApi::quickGet('membergroup_list', 'Group.php', Group::class . '::getCachedList', []);
}

// Mark read button
Expand Down
3 changes: 2 additions & 1 deletion Sources/Actions/BuddyListToggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use SMF\Db\DatabaseApi as Db;
use SMF\ErrorHandler;
use SMF\Routable;
use SMF\Tasks\Buddy_Notify;
use SMF\User;
use SMF\Utils;

Expand Down Expand Up @@ -86,7 +87,7 @@ public function execute(): void
],
[
[
'SMF\\Tasks\\Buddy_Notify',
Buddy_Notify::class,
Utils::jsonEncode([
'receiver_id' => $this->userReceiver,
'id_member' => User::$me->id,
Expand Down
2 changes: 1 addition & 1 deletion Sources/Actions/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ public static function cache_getOffsetIndependentEvents(array $eventOptions): ar
public static function cache_getRecentEvents(array $eventOptions): array
{
// With the 'static' cached data we can calculate the user-specific data.
$cached_data = CacheApi::quickGet('calendar_index', 'Actions/Calendar.php', 'SMF\\Actions\\Calendar::cache_getOffsetIndependentEvents', [$eventOptions]);
$cached_data = CacheApi::quickGet('calendar_index', 'Actions/Calendar.php', Calendar::class . '::cache_getOffsetIndependentEvents', [$eventOptions]);

// Get the information about today (from user perspective).
$today = self::getTodayInfo();
Expand Down
12 changes: 6 additions & 6 deletions Sources/Actions/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ public function getXmlMembers(): array

while ($row = Db::$db->fetch_assoc($request)) {
// If any control characters slipped in somehow, kill the evil things
$row = filter_var($row, FILTER_CALLBACK, ['options' => '\\SMF\\Utils::cleanXml']);
$row = filter_var($row, FILTER_CALLBACK, ['options' => Utils::class . '::cleanXml']);

// Create a UUID for each member
$uuid = (string) (new Uuid(5, 'member=' . $row['id_member']));
Expand Down Expand Up @@ -772,7 +772,7 @@ public function getXmlNews(): array

while ($row = Db::$db->fetch_assoc($request)) {
// If any control characters slipped in somehow, kill the evil things
$row = filter_var($row, FILTER_CALLBACK, ['options' => '\\SMF\\Utils::cleanXml']);
$row = filter_var($row, FILTER_CALLBACK, ['options' => Utils::class . '::cleanXml']);

// Old SMF versions autolinked during output rather than input,
// so maintain expected behaviour for those old messages.
Expand Down Expand Up @@ -1213,7 +1213,7 @@ public function getXmlRecent(): array

while ($row = Db::$db->fetch_assoc($request)) {
// If any control characters slipped in somehow, kill the evil things
$row = filter_var($row, FILTER_CALLBACK, ['options' => '\\SMF\\Utils::cleanXml']);
$row = filter_var($row, FILTER_CALLBACK, ['options' => Utils::class . '::cleanXml']);

// Old SMF versions autolinked during output rather than input,
// so maintain expected behaviour for those old messages.
Expand Down Expand Up @@ -1619,7 +1619,7 @@ public function getXmlProfile(): array
$profile = User::$loaded[$this->member]->format($this->format == 'smf');

// If any control characters slipped in somehow, kill the evil things
$profile = filter_var($profile, FILTER_CALLBACK, ['options' => '\\SMF\\Utils::cleanXml']);
$profile = filter_var($profile, FILTER_CALLBACK, ['options' => Utils::class . '::cleanXml']);

// Create a UUID for this member
$uuid = (string) (new Uuid(5, 'member=' . $profile['id']));
Expand Down Expand Up @@ -1979,7 +1979,7 @@ public function getXmlPosts(): array
$row['poster_ip'] = new IP($row['poster_ip']);

// If any control characters slipped in somehow, kill the evil things
$row = filter_var($row, FILTER_CALLBACK, ['options' => '\\SMF\\Utils::cleanXml']);
$row = filter_var($row, FILTER_CALLBACK, ['options' => Utils::class . '::cleanXml']);

// Old SMF versions autolinked during output rather than input,
// so maintain expected behaviour for those old messages.
Expand Down Expand Up @@ -2431,7 +2431,7 @@ public function getXmlPMs(): array
$this->start_after = (int) $row['id_pm'];

// If any control characters slipped in somehow, kill the evil things
$row = filter_var($row, FILTER_CALLBACK, ['options' => '\\SMF\\Utils::cleanXml']);
$row = filter_var($row, FILTER_CALLBACK, ['options' => Utils::class . '::cleanXml']);

// Old SMF versions autolinked during output rather than input,
// so maintain expected behaviour for those old messages.
Expand Down
3 changes: 2 additions & 1 deletion Sources/Actions/Like.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use SMF\OutputTypeInterface;
use SMF\OutputTypes;
use SMF\Routable;
use SMF\Tasks\Likes_Notify;
use SMF\Theme;
use SMF\Time;
use SMF\User;
Expand Down Expand Up @@ -518,7 +519,7 @@ protected function insert(): void
],
[
[
'SMF\\Tasks\\Likes_Notify',
Likes_Notify::class,
Utils::jsonEncode([
'content_id' => $content,
'content_type' => $type,
Expand Down
3 changes: 2 additions & 1 deletion Sources/Actions/Moderation/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use SMF\Lang;
use SMF\Menu;
use SMF\SecurityToken;
use SMF\Tasks\GroupAct_Notify;
use SMF\Theme;
use SMF\Time;
use SMF\User;
Expand Down Expand Up @@ -333,7 +334,7 @@ public function requests(): void
],
[
[
'SMF\\Tasks\\GroupAct_Notify',
GroupAct_Notify::class,
$data,
0,
],
Expand Down
5 changes: 3 additions & 2 deletions Sources/Actions/Profile/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use SMF\Lang;
use SMF\Security;
use SMF\SecurityToken;
use SMF\Tasks\ExportProfileData;
use SMF\Theme;
use SMF\Time;
use SMF\User;
Expand Down Expand Up @@ -153,7 +154,7 @@ public function execute(): void
WHERE task_class = {string:class}
AND task_data LIKE {string:details}',
[
'class' => 'SMF\\Tasks\\ExportProfileData',
'class' => ExportProfileData::class,
'details' => substr(Utils::jsonEncode(['format' => $format, 'uid' => Utils::$context['id_member']]), 0, -1) . ',%',
],
);
Expand Down Expand Up @@ -317,7 +318,7 @@ public function execute(): void
],
[
[
'SMF\\Tasks\\ExportProfileData',
ExportProfileData::class,
$data,
0,
],
Expand Down
3 changes: 2 additions & 1 deletion Sources/Actions/Profile/GroupMembership.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use SMF\Group;
use SMF\Lang;
use SMF\Profile;
use SMF\Tasks\GroupReq_Notify;
use SMF\User;
use SMF\Utils;

Expand Down Expand Up @@ -420,7 +421,7 @@ protected function sendJoinRequest(int $new_group_id): void
],
[
[
'SMF\\Tasks\\GroupReq_Notify',
GroupReq_Notify::class,
$data,
0,
],
Expand Down
3 changes: 2 additions & 1 deletion Sources/Actions/Profile/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use SMF\ActionTrait;
use SMF\Config;
use SMF\Db\DatabaseApi as Db;
use SMF\Draft;
use SMF\ErrorHandler;
use SMF\IntegrationHook;
use SMF\Lang;
Expand Down Expand Up @@ -197,7 +198,7 @@ class Main implements ActionInterface, Routable
],
'showdrafts' => [
'label' => 'drafts_show',
'function' => 'SMF\\Draft::showInProfile',
'function' => Draft::class . '::showInProfile',
'icon' => 'drafts',
'enabled' => true,
'permission' => [
Expand Down
6 changes: 4 additions & 2 deletions Sources/Actions/ReportToMod.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
use SMF\Parser;
use SMF\Routable;
use SMF\Security;
use SMF\Tasks\MemberReport_Notify;
use SMF\Tasks\MsgReport_Notify;
use SMF\Theme;
use SMF\Topic;
use SMF\User;
Expand Down Expand Up @@ -474,7 +476,7 @@ protected function reportMsg(int $msg): void
],
[
[
'SMF\\Tasks\\MsgReport_Notify',
MsgReport_Notify::class,
Utils::jsonEncode([
'report_id' => $id_report,
'msg_id' => $msg,
Expand Down Expand Up @@ -639,7 +641,7 @@ protected function reportMember(int $id_member): void
],
[
[
'SMF\\Tasks\\MemberReport_Notify',
MemberReport_Notify::class,
Utils::jsonEncode([
'report_id' => $id_report,
'user_id' => $user['id_member'],
Expand Down
4 changes: 2 additions & 2 deletions Sources/Actions/TrackIP.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ public function execute(): void
'base_href' => Utils::$context['base_url'] . ';searchip=' . Utils::$context['ip'],
'default_sort_col' => 'date2',
'get_items' => [
'function' => '\\SMF\\Actions\\Profile\\Tracking::list_getUserErrors',
'function' => \SMF\Actions\Profile\Tracking::class . '::list_getUserErrors',
'params' => [
'le.ip >= ' . $ip_string[0] . ' and le.ip <= ' . $ip_string[1],
$fields,
],
],
'get_count' => [
'function' => '\\SMF\\Actions\\Profile\\Tracking::list_getUserErrorCount',
'function' => \SMF\Actions\Profile\Tracking::class . '::list_getUserErrorCount',
'params' => [
'ip >= ' . $ip_string[0] . ' and ip <= ' . $ip_string[1],
$fields,
Expand Down
2 changes: 1 addition & 1 deletion Sources/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ public static function create(array &$attachmentOptions): bool
],
[
[
'SMF\\Tasks\\CreateAttachment_Notify',
Tasks\CreateAttachment_Notify::class,
Utils::jsonEncode(['id' => $attachmentOptions['id']]),
0,
],
Expand Down
4 changes: 3 additions & 1 deletion Sources/BBCode/Quote4.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

namespace SMF\BBCode;

use SMF\Time;

/**
* Represents the version of the quote BBCode with multiple parameters.
*/
Expand All @@ -35,7 +37,7 @@ class Quote4 extends BBCode
public ?array $parameters = [
'author' => ['match' => '([^<>]{1,192}?)'],
'link' => ['match' => '(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|msg=\d+?|action=profile;u=\d+)'],
'date' => ['match' => '(\d+)', 'validate' => 'SMF\\Time::stringFromUnix'],
'date' => ['match' => '(\d+)', 'validate' => Time::class . '::stringFromUnix'],
];

/**
Expand Down
8 changes: 4 additions & 4 deletions Sources/Cache/CacheApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ final public static function clean(string $type = ''): void
*/
final public static function quickGet(string $key, string $file, string|array $function, array $params, int $level = 1): mixed
{
if (class_exists('SMF\\IntegrationHook', false)) {
if (class_exists(IntegrationHook::class, false)) {
IntegrationHook::call('pre_cache_quick_get', [&$key, &$file, &$function, &$params, &$level]);
}

Expand Down Expand Up @@ -529,7 +529,7 @@ final public static function quickGet(string $key, string $file, string|array $f
$callback($cache_block, $params);
}

if (class_exists('SMF\\IntegrationHook', false)) {
if (class_exists(IntegrationHook::class, false)) {
IntegrationHook::call('post_cache_quick_get', [&$cache_block]);
}

Expand Down Expand Up @@ -568,7 +568,7 @@ final public static function put(string $key, mixed $value, int $ttl = 120): voi
$value = $value === null ? null : serialize($value);
self::$loadedApi->putData($key, $value, $ttl);

if (class_exists('SMF\\IntegrationHook', false)) {
if (class_exists(IntegrationHook::class, false)) {
IntegrationHook::call('cache_put_data', [&$key, &$value, &$ttl]);
}

Expand Down Expand Up @@ -613,7 +613,7 @@ final public static function get(string $key, int $ttl = 120): mixed
}
}

if (class_exists('SMF\\IntegrationHook', false) && isset($value)) {
if (class_exists(IntegrationHook::class, false) && isset($value)) {
IntegrationHook::call('cache_get_data', [&$key, &$ttl, &$value]);
}

Expand Down
Loading