diff --git a/core/extension.php b/core/extension.php
index e654406d..c6ebdb7b 100644
--- a/core/extension.php
+++ b/core/extension.php
@@ -267,7 +267,7 @@ abstract class ExtensionInfo
*/
abstract class FormatterExtension extends Extension
{
- public function onTextFormatting(TextFormattingEvent $event)
+ public function onTextFormatting(TextFormattingEvent $event): void
{
$event->formatted = $this->format($event->formatted);
$event->stripped = $this->strip($event->stripped);
@@ -287,7 +287,7 @@ abstract class DataHandlerExtension extends Extension
{
protected array $SUPPORTED_MIME = [];
- public function onDataUpload(DataUploadEvent $event)
+ public function onDataUpload(DataUploadEvent $event): void
{
global $config;
@@ -349,7 +349,7 @@ abstract class DataHandlerExtension extends Extension
}
}
- public function onThumbnailGeneration(ThumbnailGenerationEvent $event)
+ public function onThumbnailGeneration(ThumbnailGenerationEvent $event): void
{
$result = false;
if ($this->supported_mime($event->image->get_mime())) {
@@ -368,7 +368,7 @@ abstract class DataHandlerExtension extends Extension
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $config, $page;
if ($this->supported_mime($event->image->get_mime())) {
@@ -380,7 +380,7 @@ abstract class DataHandlerExtension extends Extension
}
}
- public function onMediaCheckProperties(MediaCheckPropertiesEvent $event)
+ public function onMediaCheckProperties(MediaCheckPropertiesEvent $event): void
{
if ($this->supported_mime($event->image->get_mime())) {
$this->media_check_properties($event);
diff --git a/ext/admin/main.php b/ext/admin/main.php
index 294fd5ac..1d956cc4 100644
--- a/ext/admin/main.php
+++ b/ext/admin/main.php
@@ -39,7 +39,7 @@ class AdminPage extends Extension
/** @var AdminPageTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;
@@ -69,7 +69,7 @@ class AdminPage extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('page:get')
->addArgument('query', InputArgument::REQUIRED)
@@ -155,12 +155,12 @@ class AdminPage extends Extension
});
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_page();
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -170,7 +170,7 @@ class AdminPage extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_ADMINTOOLS)) {
diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php
index c648f63a..2658733a 100644
--- a/ext/alias_editor/main.php
+++ b/ext/alias_editor/main.php
@@ -61,7 +61,7 @@ class AliasEditor extends Extension
/** @var AliasEditorTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page, $user;
@@ -120,7 +120,7 @@ class AliasEditor extends Extension
}
}
- public function onAddAlias(AddAliasEvent $event)
+ public function onAddAlias(AddAliasEvent $event): void
{
global $database;
@@ -147,21 +147,21 @@ class AliasEditor extends Extension
log_info("alias_editor", "Added alias for {$event->oldtag} -> {$event->newtag}", "Added alias");
}
- public function onDeleteAlias(DeleteAliasEvent $event)
+ public function onDeleteAlias(DeleteAliasEvent $event): void
{
global $database;
$database->execute("DELETE FROM aliases WHERE oldtag=:oldtag", ["oldtag" => $event->oldtag]);
log_info("alias_editor", "Deleted alias for {$event->oldtag}", "Deleted alias");
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "tags") {
$event->add_nav_link("aliases", new Link('alias/list'), "Aliases", NavLink::is_active(["alias"]));
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_ALIAS_LIST)) {
diff --git a/ext/approval/main.php b/ext/approval/main.php
index baa02ffd..7bbbde8a 100644
--- a/ext/approval/main.php
+++ b/ext/approval/main.php
@@ -16,7 +16,7 @@ class Approval extends Extension
/** @var ApprovalTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
@@ -26,7 +26,7 @@ class Approval extends Extension
Image::$bool_props[] = "approved";
}
- public function onImageAddition(ImageAdditionEvent $event)
+ public function onImageAddition(ImageAdditionEvent $event): void
{
global $user, $config;
@@ -35,7 +35,7 @@ class Approval extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@@ -70,17 +70,17 @@ class Approval extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$this->theme->display_admin_block($event);
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_form();
}
- public function onAdminAction(AdminActionEvent $event)
+ public function onAdminAction(AdminActionEvent $event): void
{
global $database, $user;
@@ -110,7 +110,7 @@ class Approval extends Extension
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
@@ -120,7 +120,7 @@ class Approval extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent == "posts") {
@@ -130,7 +130,7 @@ class Approval extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::APPROVE_IMAGE)) {
@@ -139,7 +139,7 @@ class Approval extends Extension
}
public const SEARCH_REGEXP = "/^approved:(yes|no)/";
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
global $user, $config;
@@ -163,7 +163,7 @@ class Approval extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
global $user, $config;
if ($event->key === HelpPages::SEARCH) {
@@ -214,7 +214,7 @@ class Approval extends Extension
return true;
}
- public function onImageDownloading(ImageDownloadingEvent $event)
+ public function onImageDownloading(ImageDownloadingEvent $event): void
{
/**
* Deny images upon insufficient permissions.
@@ -224,7 +224,7 @@ class Approval extends Extension
}
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user, $config;
if ($user->can(Permissions::APPROVE_IMAGE) && $config->get_bool(ApprovalConfig::IMAGES)) {
@@ -232,7 +232,7 @@ class Approval extends Extension
}
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user, $config;
@@ -245,7 +245,7 @@ class Approval extends Extension
}
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@@ -273,7 +273,7 @@ class Approval extends Extension
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
diff --git a/ext/artists/main.php b/ext/artists/main.php
index 05eba47c..f286c2bd 100644
--- a/ext/artists/main.php
+++ b/ext/artists/main.php
@@ -24,7 +24,7 @@ class Artists extends Extension
/** @var ArtistsTheme */
protected Themelet $theme;
- public function onImageInfoSet(ImageInfoSetEvent $event)
+ public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_ARTIST) && isset($_POST["tag_edit__author"])) {
@@ -32,7 +32,7 @@ class Artists extends Extension
}
}
- public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
+ public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $user;
$artistName = $this->get_artistName_by_imageID($event->image->id);
@@ -41,7 +41,7 @@ class Artists extends Extension
}
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@@ -54,14 +54,14 @@ class Artists extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$event->add_block(new Block("Artist", $this->theme->get_help_html()));
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;
@@ -113,7 +113,7 @@ class Artists extends Extension
}
}
- public function onAuthorSet(AuthorSetEvent $event)
+ public function onAuthorSet(AuthorSetEvent $event): void
{
global $database;
@@ -154,7 +154,7 @@ class Artists extends Extension
);
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
diff --git a/ext/auto_tagger/main.php b/ext/auto_tagger/main.php
index eabb8df8..701abecd 100644
--- a/ext/auto_tagger/main.php
+++ b/ext/auto_tagger/main.php
@@ -67,7 +67,7 @@ class AutoTagger extends Extension
/** @var AutoTaggerTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page, $user;
@@ -126,14 +126,14 @@ class AutoTagger extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "tags") {
$event->add_nav_link("auto_tag", new Link('auto_tag/list'), "Auto-Tag", NavLink::is_active(["auto_tag"]));
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -153,7 +153,7 @@ class AutoTagger extends Extension
}
}
- public function onTagSet(TagSetEvent $event)
+ public function onTagSet(TagSetEvent $event): void
{
$results = $this->apply_auto_tags($event->new_tags);
if (!empty($results)) {
@@ -161,19 +161,19 @@ class AutoTagger extends Extension
}
}
- public function onAddAutoTag(AddAutoTagEvent $event)
+ public function onAddAutoTag(AddAutoTagEvent $event): void
{
global $page;
$this->add_auto_tag($event->tag, $event->additional_tags);
$page->flash("Added Auto-Tag");
}
- public function onDeleteAutoTag(DeleteAutoTagEvent $event)
+ public function onDeleteAutoTag(DeleteAutoTagEvent $event): void
{
$this->remove_auto_tag($event->tag);
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_AUTO_TAG)) {
diff --git a/ext/autocomplete/main.php b/ext/autocomplete/main.php
index a58994c2..521e0b8e 100644
--- a/ext/autocomplete/main.php
+++ b/ext/autocomplete/main.php
@@ -11,7 +11,7 @@ class AutoComplete extends Extension
return 30;
} // before Home
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page;
diff --git a/ext/ban_words/main.php b/ext/ban_words/main.php
index 0247c7ea..94636ea6 100644
--- a/ext/ban_words/main.php
+++ b/ext/ban_words/main.php
@@ -6,7 +6,7 @@ namespace Shimmie2;
class BanWords extends Extension
{
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string('banned_words', "
@@ -39,7 +39,7 @@ xanax
");
}
- public function onCommentPosting(CommentPostingEvent $event)
+ public function onCommentPosting(CommentPostingEvent $event): void
{
global $user;
if (!$user->can(Permissions::BYPASS_COMMENT_CHECKS)) {
@@ -47,17 +47,17 @@ xanax
}
}
- public function onSourceSet(SourceSetEvent $event)
+ public function onSourceSet(SourceSetEvent $event): void
{
$this->test_text($event->source, new SCoreException("Source contains banned terms"));
}
- public function onTagSet(TagSetEvent $event)
+ public function onTagSet(TagSetEvent $event): void
{
$this->test_text(Tag::implode($event->new_tags), new SCoreException("Tags contain banned terms"));
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Banned Phrases");
$sb->add_label("One per line, lines that start with slashes are treated as regex
");
diff --git a/ext/biography/main.php b/ext/biography/main.php
index fac41f5f..d645cd93 100644
--- a/ext/biography/main.php
+++ b/ext/biography/main.php
@@ -9,7 +9,7 @@ class Biography extends Extension
/** @var BiographyTheme */
protected Themelet $theme;
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $page, $user;
$duser = $event->display_user;
@@ -23,7 +23,7 @@ class Biography extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user, $user_config;
if ($event->page_matches("biography")) {
diff --git a/ext/blocks/main.php b/ext/blocks/main.php
index 2711fd9a..e06eccaa 100644
--- a/ext/blocks/main.php
+++ b/ext/blocks/main.php
@@ -9,7 +9,7 @@ class Blocks extends Extension
/** @var BlocksTheme */
protected Themelet $theme;
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
if ($this->get_version("ext_blocks_version") < 1) {
@@ -31,7 +31,7 @@ class Blocks extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -41,7 +41,7 @@ class Blocks extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_BLOCKS)) {
@@ -49,7 +49,7 @@ class Blocks extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $database, $page, $user;
diff --git a/ext/blotter/main.php b/ext/blotter/main.php
index 1450d547..ef8137b8 100644
--- a/ext/blotter/main.php
+++ b/ext/blotter/main.php
@@ -9,7 +9,7 @@ class Blotter extends Extension
/** @var BlotterTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("blotter_recent", 5);
@@ -17,7 +17,7 @@ class Blotter extends Extension
$config->set_default_string("blotter_position", "subheading");
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -42,7 +42,7 @@ class Blotter extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Blotter");
$sb->add_int_option("blotter_recent", "
Number of recent entries to display: ");
@@ -50,7 +50,7 @@ class Blotter extends Extension
$sb->add_choice_option("blotter_position", ["Top of page" => "subheading", "In navigation bar" => "left"], "
Position: ");
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -61,7 +61,7 @@ class Blotter extends Extension
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BLOTTER_ADMIN)) {
@@ -69,7 +69,7 @@ class Blotter extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $database, $user;
if ($event->page_matches("blotter") && $event->count_args() > 0) {
diff --git a/ext/browser_search/main.php b/ext/browser_search/main.php
index 4cdb3542..87af19ba 100644
--- a/ext/browser_search/main.php
+++ b/ext/browser_search/main.php
@@ -6,13 +6,13 @@ namespace Shimmie2;
class BrowserSearch extends Extension
{
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("search_suggestions_results_order", 'a');
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page;
@@ -75,7 +75,7 @@ class BrowserSearch extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sort_by = [];
$sort_by['Alphabetical'] = 'a';
diff --git a/ext/bulk_actions/main.php b/ext/bulk_actions/main.php
index b22d72d0..be071314 100644
--- a/ext/bulk_actions/main.php
+++ b/ext/bulk_actions/main.php
@@ -57,7 +57,7 @@ class BulkActions extends Extension
/** @var BulkActionsTheme */
protected Themelet $theme;
- public function onPostListBuilding(PostListBuildingEvent $event)
+ public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $page, $user;
@@ -77,7 +77,7 @@ class BulkActions extends Extension
}
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@@ -101,7 +101,7 @@ class BulkActions extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('bulk-action')
->addArgument('action', InputArgument::REQUIRED)
@@ -117,7 +117,7 @@ class BulkActions extends Extension
});
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@@ -156,7 +156,7 @@ class BulkActions extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("bulk_action") && $user->can(Permissions::PERFORM_BULK_ACTIONS)) {
diff --git a/ext/bulk_add/main.php b/ext/bulk_add/main.php
index c6cf8bdb..88e44ce8 100644
--- a/ext/bulk_add/main.php
+++ b/ext/bulk_add/main.php
@@ -27,7 +27,7 @@ class BulkAdd extends Extension
/** @var BulkAddTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("bulk_add")) {
@@ -39,7 +39,7 @@ class BulkAdd extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('bulk-add')
->addArgument('directory', InputArgument::REQUIRED)
@@ -58,12 +58,12 @@ class BulkAdd extends Extension
});
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
- public function onBulkAdd(BulkAddEvent $event)
+ public function onBulkAdd(BulkAddEvent $event): void
{
if (is_dir($event->dir) && is_readable($event->dir)) {
$event->results = add_dir($event->dir);
diff --git a/ext/bulk_add_csv/main.php b/ext/bulk_add_csv/main.php
index aa79255a..99a4bbe3 100644
--- a/ext/bulk_add_csv/main.php
+++ b/ext/bulk_add_csv/main.php
@@ -13,7 +13,7 @@ class BulkAddCSV extends Extension
/** @var BulkAddCSVTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("bulk_add_csv")) {
@@ -25,7 +25,7 @@ class BulkAddCSV extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('bulk-add-csv')
->addArgument('path-to-csv', InputArgument::REQUIRED)
@@ -43,7 +43,7 @@ class BulkAddCSV extends Extension
});
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
diff --git a/ext/bulk_download/main.php b/ext/bulk_download/main.php
index 1947889e..f7659d10 100644
--- a/ext/bulk_download/main.php
+++ b/ext/bulk_download/main.php
@@ -17,13 +17,13 @@ class BulkDownload extends Extension
{
private const DOWNLOAD_ACTION_NAME = "bulk_download";
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int(BulkDownloadConfig::SIZE_LIMIT, parse_shorthand_int('100MB'));
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@@ -32,7 +32,7 @@ class BulkDownload extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Bulk Download");
@@ -41,7 +41,7 @@ class BulkDownload extends Extension
$sb->end_table();
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $user, $page, $config;
diff --git a/ext/bulk_import_export/main.php b/ext/bulk_import_export/main.php
index 87b88a7e..12851520 100644
--- a/ext/bulk_import_export/main.php
+++ b/ext/bulk_import_export/main.php
@@ -11,7 +11,7 @@ class BulkImportExport extends DataHandlerExtension
protected array $SUPPORTED_MIME = [MimeType::ZIP];
- public function onDataUpload(DataUploadEvent $event)
+ public function onDataUpload(DataUploadEvent $event): void
{
global $user, $database;
@@ -89,7 +89,7 @@ class BulkImportExport extends DataHandlerExtension
}
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@@ -98,7 +98,7 @@ class BulkImportExport extends DataHandlerExtension
}
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $user, $page;
diff --git a/ext/bulk_parent_child/main.php b/ext/bulk_parent_child/main.php
index 4729f70c..c318776e 100644
--- a/ext/bulk_parent_child/main.php
+++ b/ext/bulk_parent_child/main.php
@@ -15,7 +15,7 @@ class BulkParentChild extends Extension
{
private const PARENT_CHILD_ACTION_NAME = "bulk_parent_child";
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@@ -24,7 +24,7 @@ class BulkParentChild extends Extension
}
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $user, $page, $config;
if ($user->can(Permissions::BULK_PARENT_CHILD) &&
diff --git a/ext/comment/main.php b/ext/comment/main.php
index 83f95c9c..528ce44a 100644
--- a/ext/comment/main.php
+++ b/ext/comment/main.php
@@ -116,7 +116,7 @@ class CommentList extends Extension
/** @var CommentListTheme $theme */
public Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int('comment_window', 5);
@@ -126,7 +126,7 @@ class CommentList extends Extension
$config->set_default_bool('comment_captcha', false);
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
if ($this->get_version("ext_comments_version") < 3) {
@@ -179,13 +179,13 @@ class CommentList extends Extension
}
- public function onPageNavBuilding(PageNavBuildingEvent $event)
+ public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("comment", new Link('comment/list'), "Comments");
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "comment") {
$event->add_nav_link("comment_list", new Link('comment/list'), "All");
@@ -193,7 +193,7 @@ class CommentList extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("comment")) {
switch ($event->get_arg(0)) {
@@ -216,7 +216,7 @@ class CommentList extends Extension
}
}
- public function onRobotsBuilding(RobotsBuildingEvent $event)
+ public function onRobotsBuilding(RobotsBuildingEvent $event): void
{
// comment lists change all the time, crawlers should
// index individual image's comments
@@ -344,12 +344,12 @@ class CommentList extends Extension
$this->theme->display_all_user_comments($comments, $page_num + 1, $total_pages, $duser);
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
- public function onPostListBuilding(PostListBuildingEvent $event)
+ public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $cache, $config;
$cc = $config->get_int("comment_count");
@@ -361,7 +361,7 @@ class CommentList extends Extension
}
}
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
$i_days_old = ((time() - strtotime($event->display_user->join_date)) / 86400) + 1;
$i_comment_count = Comment::count_comments_by_user($event->display_user);
@@ -372,7 +372,7 @@ class CommentList extends Extension
$this->theme->display_recent_user_comments($recent, $event->display_user);
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $user;
$this->theme->display_image_comments(
@@ -383,12 +383,12 @@ class CommentList extends Extension
}
// TODO: split akismet into a separate class, which can veto the event
- public function onCommentPosting(CommentPostingEvent $event)
+ public function onCommentPosting(CommentPostingEvent $event): void
{
$this->add_comment_wrapper($event->image_id, $event->user, $event->comment);
}
- public function onCommentDeletion(CommentDeletionEvent $event)
+ public function onCommentDeletion(CommentDeletionEvent $event): void
{
global $database;
$database->execute("
@@ -398,7 +398,7 @@ class CommentList extends Extension
log_info("comment", "Deleting Comment #{$event->comment_id}");
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Comment Options");
$sb->add_bool_option("comment_captcha", "Require CAPTCHA for anonymous comments: ");
@@ -417,7 +417,7 @@ class CommentList extends Extension
$sb->add_bool_option("comment_samefags_public");
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@@ -437,7 +437,7 @@ class CommentList extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
diff --git a/ext/cron_uploader/main.php b/ext/cron_uploader/main.php
index d5edd13e..6f2e0de9 100644
--- a/ext/cron_uploader/main.php
+++ b/ext/cron_uploader/main.php
@@ -21,7 +21,7 @@ class CronUploader extends Extension
private static bool $IMPORT_RUNNING = false;
- public function onInitUserConfig(InitUserConfigEvent $event)
+ public function onInitUserConfig(InitUserConfigEvent $event): void
{
$event->user_config->set_default_string(
CronUploaderConfig::DIR,
@@ -32,7 +32,7 @@ class CronUploader extends Extension
$event->user_config->set_default_int(CronUploaderConfig::LOG_LEVEL, SCORE_LOG_INFO);
}
- public function onUserOptionsBuilding(UserOptionsBuildingEvent $event)
+ public function onUserOptionsBuilding(UserOptionsBuildingEvent $event): void
{
if ($event->user->can(Permissions::CRON_ADMIN)) {
$documentation_link = make_http(make_link("cron_upload"));
@@ -55,7 +55,7 @@ class CronUploader extends Extension
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "system") {
$event->add_nav_link("cron_docs", new Link('cron_upload'), "Cron Upload");
@@ -66,7 +66,7 @@ class CronUploader extends Extension
* Checks if the cron upload page has been accessed
* and initializes the upload.
*/
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $user;
@@ -79,7 +79,7 @@ class CronUploader extends Extension
}
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
$failed_dir = $this->get_failed_dir();
$results = get_dir_contents($failed_dir);
@@ -95,7 +95,7 @@ class CronUploader extends Extension
$this->theme->display_form($failed_dirs);
}
- public function onAdminAction(AdminActionEvent $event)
+ public function onAdminAction(AdminActionEvent $event): void
{
$action = $event->action;
switch ($action) {
@@ -120,7 +120,7 @@ class CronUploader extends Extension
}
}
- public function onLog(LogEvent $event)
+ public function onLog(LogEvent $event): void
{
global $user_config;
diff --git a/ext/custom_html_headers/main.php b/ext/custom_html_headers/main.php
index 93880e3a..8e73c6d4 100644
--- a/ext/custom_html_headers/main.php
+++ b/ext/custom_html_headers/main.php
@@ -7,7 +7,7 @@ namespace Shimmie2;
class CustomHtmlHeaders extends Extension
{
# Adds setup block for custom
content
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Custom HTML Headers");
@@ -25,14 +25,14 @@ class CustomHtmlHeaders extends Extension
], "
Add website name in title");
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("sitename_in_title", "none");
}
# Load Analytics tracking code on page request
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
$this->handle_custom_html_headers();
$this->handle_modified_page_title();
diff --git a/ext/danbooru_api/main.php b/ext/danbooru_api/main.php
index 99212c7a..8e500878 100644
--- a/ext/danbooru_api/main.php
+++ b/ext/danbooru_api/main.php
@@ -26,7 +26,7 @@ function POST(...$args): HTMLElement
class DanbooruApi extends Extension
{
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("api/danbooru")) {
global $page;
diff --git a/ext/download/main.php b/ext/download/main.php
index 5bf5facc..d46a3d45 100644
--- a/ext/download/main.php
+++ b/ext/download/main.php
@@ -14,7 +14,7 @@ class Download extends Extension
return 99;
}
- public function onImageDownloading(ImageDownloadingEvent $event)
+ public function onImageDownloading(ImageDownloadingEvent $event): void
{
global $page;
diff --git a/ext/downtime/main.php b/ext/downtime/main.php
index 28d6aeef..d931a6b8 100644
--- a/ext/downtime/main.php
+++ b/ext/downtime/main.php
@@ -14,14 +14,14 @@ class Downtime extends Extension
return 10;
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Downtime");
$sb->add_bool_option("downtime", "Disable non-admin access: ");
$sb->add_longtext_option("downtime_message", "
");
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page, $user;
diff --git a/ext/emoticons_list/main.php b/ext/emoticons_list/main.php
index 07bd6f80..b66e0649 100644
--- a/ext/emoticons_list/main.php
+++ b/ext/emoticons_list/main.php
@@ -12,7 +12,7 @@ class EmoticonList extends Extension
/** @var EmoticonListTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("emote/list")) {
$this->theme->display_emotes(glob("ext/emoticons/default/*"));
diff --git a/ext/eokm/main.php b/ext/eokm/main.php
index 83b98f32..1bc13942 100644
--- a/ext/eokm/main.php
+++ b/ext/eokm/main.php
@@ -11,7 +11,7 @@ class Eokm extends Extension
return 40;
} // early, to veto ImageUploadEvent
- public function onImageAddition(ImageAdditionEvent $event)
+ public function onImageAddition(ImageAdditionEvent $event): void
{
global $config;
$username = $config->get_string("eokm_username");
@@ -41,7 +41,7 @@ class Eokm extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("EOKM Filter");
diff --git a/ext/et/main.php b/ext/et/main.php
index 21bf015f..5b6cfc57 100644
--- a/ext/et/main.php
+++ b/ext/et/main.php
@@ -13,7 +13,7 @@ class ET extends Extension
/** @var ETTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $user;
if ($event->page_matches("system_info")) {
@@ -23,7 +23,7 @@ class ET extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -33,7 +33,7 @@ class ET extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_SYSINTO)) {
@@ -41,7 +41,7 @@ class ET extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('info')
->setDescription('List a bunch of info')
diff --git a/ext/et_server/main.php b/ext/et_server/main.php
index dbc314c6..c78c30b2 100644
--- a/ext/et_server/main.php
+++ b/ext/et_server/main.php
@@ -8,7 +8,7 @@ use function MicroHTML\{PRE};
class ETServer extends Extension
{
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;
if ($event->page_matches("register.php")) {
@@ -36,7 +36,7 @@ class ETServer extends Extension
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
diff --git a/ext/ext_manager/main.php b/ext/ext_manager/main.php
index ac14990f..1b5ab95c 100644
--- a/ext/ext_manager/main.php
+++ b/ext/ext_manager/main.php
@@ -25,7 +25,7 @@ class ExtManager extends Extension
/** @var ExtManagerTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("ext_manager")) {
@@ -64,7 +64,7 @@ class ExtManager extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('disable-all-ext')
->setDescription('Disable all extensions')
@@ -74,7 +74,7 @@ class ExtManager extends Extension
});
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -86,7 +86,7 @@ class ExtManager extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_EXTENSION_LIST)) {
diff --git a/ext/favorites/main.php b/ext/favorites/main.php
index c66a731a..81b427aa 100644
--- a/ext/favorites/main.php
+++ b/ext/favorites/main.php
@@ -27,7 +27,7 @@ class Favorites extends Extension
/** @var FavoritesTheme */
protected Themelet $theme;
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $database, $user;
if (!$user->is_anonymous()) {
@@ -43,7 +43,7 @@ class Favorites extends Extension
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
$people = $this->list_persons_who_have_favorited($event->image);
if (count($people) > 0) {
@@ -51,7 +51,7 @@ class Favorites extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("change_favorite") && !$user->is_anonymous() && $user->check_auth_token()) {
@@ -70,7 +70,7 @@ class Favorites extends Extension
}
}
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
$i_favorites_count = Search::count_images(["favorited_by={$event->display_user->name}"]);
$i_days_old = ((time() - strtotime($event->display_user->join_date)) / 86400) + 1;
@@ -79,7 +79,7 @@ class Favorites extends Extension
$event->add_stats("Posts favorited: $i_favorites_count, $h_favorites_rate per day");
}
- public function onImageInfoSet(ImageInfoSetEvent $event)
+ public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
if (
@@ -91,7 +91,7 @@ class Favorites extends Extension
}
}
- public function onFavoriteSet(FavoriteSetEvent $event)
+ public function onFavoriteSet(FavoriteSetEvent $event): void
{
global $user;
$this->add_vote($event->image_id, $user->id, $event->do_set);
@@ -99,18 +99,18 @@ class Favorites extends Extension
// FIXME: this should be handled by the foreign key. Check that it
// is, and then remove this
- public function onImageDeletion(ImageDeletionEvent $event)
+ public function onImageDeletion(ImageDeletionEvent $event): void
{
global $database;
$database->execute("DELETE FROM user_favorites WHERE image_id=:image_id", ["image_id" => $event->image->id]);
}
- public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
+ public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$event->replace('$favorites', (string)$event->image->favorites);
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
@@ -118,7 +118,7 @@ class Favorites extends Extension
$event->add_link("My Favorites", search_link(["favorited_by=$username"]), 20);
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@@ -142,14 +142,14 @@ class Favorites extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$event->add_block(new Block("Favorites", $this->theme->get_help_html()));
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent == "posts") {
@@ -164,7 +164,7 @@ class Favorites extends Extension
}
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@@ -174,7 +174,7 @@ class Favorites extends Extension
}
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@@ -202,7 +202,7 @@ class Favorites extends Extension
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
diff --git a/ext/featured/main.php b/ext/featured/main.php
index de82bde3..277db059 100644
--- a/ext/featured/main.php
+++ b/ext/featured/main.php
@@ -9,13 +9,13 @@ class Featured extends Extension
/** @var FeaturedTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int('featured_id', 0);
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page, $user;
if ($event->page_matches("featured_image")) {
@@ -47,7 +47,7 @@ class Featured extends Extension
}
}
- public function onPostListBuilding(PostListBuildingEvent $event)
+ public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $cache, $config, $page, $user;
$fid = $config->get_int("featured_id");
@@ -74,7 +74,7 @@ class Featured extends Extension
}
}
- public function onImageDeletion(ImageDeletionEvent $event)
+ public function onImageDeletion(ImageDeletionEvent $event): void
{
global $config;
if ($event->image->id == $config->get_int("featured_id")) {
@@ -83,7 +83,7 @@ class Featured extends Extension
}
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_FEATURE) && $event->context == "view") {
diff --git a/ext/forum/main.php b/ext/forum/main.php
index 060735a7..c65f78fe 100644
--- a/ext/forum/main.php
+++ b/ext/forum/main.php
@@ -17,7 +17,7 @@ class Forum extends Extension
/** @var ForumTheme */
protected Themelet $theme;
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;
@@ -65,7 +65,7 @@ class Forum extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Forum");
$sb->add_int_option("forumTitleSubString", "Title max long: ");
@@ -75,7 +75,7 @@ class Forum extends Extension
$sb->add_int_option("forumMaxCharsPerPost", "
Max chars per post: ");
}
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $database;
@@ -91,12 +91,12 @@ class Forum extends Extension
$event->add_stats("Forum posts: $posts_count, $posts_rate per day");
}
- public function onPageNavBuilding(PageNavBuildingEvent $event)
+ public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("forum", new Link('forum/index'), "Forum");
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
diff --git a/ext/four_oh_four/main.php b/ext/four_oh_four/main.php
index 836c8f24..162d28fc 100644
--- a/ext/four_oh_four/main.php
+++ b/ext/four_oh_four/main.php
@@ -6,7 +6,7 @@ namespace Shimmie2;
class FourOhFour extends Extension
{
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page;
// hax.
diff --git a/ext/google_analytics/main.php b/ext/google_analytics/main.php
index a9759374..ee7cd278 100644
--- a/ext/google_analytics/main.php
+++ b/ext/google_analytics/main.php
@@ -7,7 +7,7 @@ namespace Shimmie2;
class GoogleAnalytics extends Extension
{
# Add analytics to config
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Google Analytics");
$sb->add_text_option("google_analytics_id", "Analytics ID: ");
@@ -15,7 +15,7 @@ class GoogleAnalytics extends Extension
}
# Load Analytics tracking code on page request
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
diff --git a/ext/graphql/main.php b/ext/graphql/main.php
index 9fb644b1..4dc88f61 100644
--- a/ext/graphql/main.php
+++ b/ext/graphql/main.php
@@ -74,14 +74,14 @@ class GraphQL extends Extension
}
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string('graphql_cors_pattern', "");
$config->set_default_bool('graphql_debug', false);
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
if ($event->page_matches("graphql")) {
@@ -177,7 +177,7 @@ class GraphQL extends Extension
return ["image_ids" => array_map(fn ($im) => $im->id, $event->images)];
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('graphql:query')
->addArgument('query', InputArgument::REQUIRED)
diff --git a/ext/handle_archive/main.php b/ext/handle_archive/main.php
index 7b8215f6..85851ddb 100644
--- a/ext/handle_archive/main.php
+++ b/ext/handle_archive/main.php
@@ -8,13 +8,13 @@ class ArchiveFileHandler extends DataHandlerExtension
{
protected array $SUPPORTED_MIME = [MimeType::ZIP];
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string('archive_extract_command', 'unzip -d "%d" "%f"');
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Archive Handler Options");
$sb->add_text_option("archive_tmp_dir", "Temporary folder: ");
@@ -22,7 +22,7 @@ class ArchiveFileHandler extends DataHandlerExtension
$sb->add_label("
%f for archive, %d for temporary directory");
}
- public function onDataUpload(DataUploadEvent $event)
+ public function onDataUpload(DataUploadEvent $event): void
{
if ($this->supported_mime($event->mime)) {
global $config, $page;
@@ -50,7 +50,7 @@ class ArchiveFileHandler extends DataHandlerExtension
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
}
diff --git a/ext/handle_pixel/main.php b/ext/handle_pixel/main.php
index c3f1d828..ba2af98d 100644
--- a/ext/handle_pixel/main.php
+++ b/ext/handle_pixel/main.php
@@ -52,7 +52,7 @@ class PixelFileHandler extends DataHandlerExtension
}
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
if ($event->context == "view") {
$event->add_part("
diff --git a/ext/handle_svg/main.php b/ext/handle_svg/main.php
index 5925d899..5b5d2378 100644
--- a/ext/handle_svg/main.php
+++ b/ext/handle_svg/main.php
@@ -13,7 +13,7 @@ class SVGFileHandler extends DataHandlerExtension
/** @var SVGFileHandlerTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page;
if ($event->page_matches("get_svg")) {
@@ -32,7 +32,7 @@ class SVGFileHandler extends DataHandlerExtension
}
}
- public function onDataUpload(DataUploadEvent $event)
+ public function onDataUpload(DataUploadEvent $event): void
{
global $config;
diff --git a/ext/handle_video/main.php b/ext/handle_video/main.php
index de6cecc8..0b294a29 100644
--- a/ext/handle_video/main.php
+++ b/ext/handle_video/main.php
@@ -26,7 +26,7 @@ class VideoFileHandler extends DataHandlerExtension
];
protected array $SUPPORTED_MIME = self::SUPPORTED_MIME;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
@@ -48,7 +48,7 @@ class VideoFileHandler extends DataHandlerExtension
return $output;
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Video Options");
$sb->start_table();
diff --git a/ext/help_pages/main.php b/ext/help_pages/main.php
index 03fadbda..4568842c 100644
--- a/ext/help_pages/main.php
+++ b/ext/help_pages/main.php
@@ -40,7 +40,7 @@ class HelpPages extends Extension
protected Themelet $theme;
public const SEARCH = "search";
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page;
@@ -74,18 +74,18 @@ class HelpPages extends Extension
}
}
- public function onHelpPageListBuilding(HelpPageListBuildingEvent $event)
+ public function onHelpPageListBuilding(HelpPageListBuildingEvent $event): void
{
$event->add_page("search", "Searching");
$event->add_page("licenses", "Licenses");
}
- public function onPageNavBuilding(PageNavBuildingEvent $event)
+ public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("help", new Link('help'), "Help");
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "help") {
$pages = send_event(new HelpPageListBuildingEvent())->pages;
@@ -95,12 +95,12 @@ class HelpPages extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
$event->add_link("Help", make_link("help"));
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key == "licenses") {
$block = new Block("Software Licenses");
diff --git a/ext/holiday/main.php b/ext/holiday/main.php
index 4386fe5c..28793cc9 100644
--- a/ext/holiday/main.php
+++ b/ext/holiday/main.php
@@ -9,19 +9,19 @@ class Holiday extends Extension
/** @var HolidayTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool("holiday_aprilfools", false);
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Holiday Theme");
$sb->add_bool_option("holiday_aprilfools", "Enable April Fools");
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config;
if (date('d/m') == '01/04' && $config->get_bool("holiday_aprilfools")) {
diff --git a/ext/home/main.php b/ext/home/main.php
index 8a02bce6..8442bc72 100644
--- a/ext/home/main.php
+++ b/ext/home/main.php
@@ -9,7 +9,7 @@ class Home extends Extension
/** @var HomeTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
if ($event->page_matches("home")) {
@@ -23,7 +23,7 @@ class Home extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$counters = [];
$counters["None"] = "none";
diff --git a/ext/image/main.php b/ext/image/main.php
index d2836ed0..b90942f0 100644
--- a/ext/image/main.php
+++ b/ext/image/main.php
@@ -40,7 +40,7 @@ class ImageIO extends Extension
'WEBP (Not IE compatible)' => MimeType::WEBP
];
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string(ImageConfig::THUMB_ENGINE, MediaEngine::GD);
@@ -62,7 +62,7 @@ class ImageIO extends Extension
$config->set_default_int(ImageConfig::EXPIRES, (60 * 60 * 24 * 31)); // defaults to one month
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config;
@@ -81,7 +81,7 @@ class ImageIO extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
@@ -113,7 +113,7 @@ class ImageIO extends Extension
}
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
@@ -122,7 +122,7 @@ class ImageIO extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('delete')
->addArgument('id', InputArgument::REQUIRED)
@@ -135,18 +135,18 @@ class ImageIO extends Extension
});
}
- public function onImageAddition(ImageAdditionEvent $event)
+ public function onImageAddition(ImageAdditionEvent $event): void
{
send_event(new ThumbnailGenerationEvent($event->image));
log_info("image", "Uploaded >>{$event->image->id} ({$event->image->hash})");
}
- public function onImageDeletion(ImageDeletionEvent $event)
+ public function onImageDeletion(ImageDeletionEvent $event): void
{
$event->image->delete();
}
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
$u_name = url_escape($event->display_user->name);
$i_image_count = Search::count_images(["user={$event->display_user->name}"]);
@@ -156,7 +156,7 @@ class ImageIO extends Extension
$event->add_stats("Posts uploaded: $i_image_count, $h_image_rate per day");
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $config;
@@ -199,7 +199,7 @@ class ImageIO extends Extension
$sb->end_table();
}
- public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
+ public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$fname = $event->image->get_filename();
$base_fname = str_contains($fname, '.') ? substr($fname, 0, strrpos($fname, '.')) : $fname;
diff --git a/ext/image_hash_ban/main.php b/ext/image_hash_ban/main.php
index c2a85bd0..33fe41be 100644
--- a/ext/image_hash_ban/main.php
+++ b/ext/image_hash_ban/main.php
@@ -62,7 +62,7 @@ class ImageBan extends Extension
/** @var ImageBanTheme */
protected Themelet $theme;
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
if ($this->get_version("ext_imageban_version") < 1) {
@@ -76,7 +76,7 @@ class ImageBan extends Extension
}
}
- public function onDataUpload(DataUploadEvent $event)
+ public function onDataUpload(DataUploadEvent $event): void
{
global $database;
$row = $database->get_row("SELECT * FROM image_bans WHERE hash = :hash", ["hash" => $event->hash]);
@@ -86,7 +86,7 @@ class ImageBan extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;
@@ -128,7 +128,7 @@ class ImageBan extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -138,7 +138,7 @@ class ImageBan extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IMAGE)) {
@@ -146,7 +146,7 @@ class ImageBan extends Extension
}
}
- public function onAddImageHashBan(AddImageHashBanEvent $event)
+ public function onAddImageHashBan(AddImageHashBanEvent $event): void
{
global $database;
$database->execute(
@@ -156,13 +156,13 @@ class ImageBan extends Extension
log_info("image_hash_ban", "Banned hash {$event->hash} because '{$event->reason}'");
}
- public function onRemoveImageHashBan(RemoveImageHashBanEvent $event)
+ public function onRemoveImageHashBan(RemoveImageHashBanEvent $event): void
{
global $database;
$database->execute("DELETE FROM image_bans WHERE hash = :hash", ["hash" => $event->hash]);
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IMAGE)) {
diff --git a/ext/image_view_counter/main.php b/ext/image_view_counter/main.php
index 7df1a285..c3534589 100644
--- a/ext/image_view_counter/main.php
+++ b/ext/image_view_counter/main.php
@@ -13,14 +13,14 @@ class ImageViewCounter extends Extension
private int $view_interval = 3600; # allows views to be added each hour
# Add Setup Block with options for view counter
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Post View Counter");
$sb->add_bool_option("image_viewcounter_adminonly", "Display view counter only to admin");
}
# Adds view to database if needed
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $database, $user;
@@ -60,7 +60,7 @@ class ImageViewCounter extends Extension
);
}
- public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
+ public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $user, $database;
@@ -74,7 +74,7 @@ class ImageViewCounter extends Extension
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database, $config;
@@ -89,7 +89,7 @@ class ImageViewCounter extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $database;
@@ -108,7 +108,7 @@ class ImageViewCounter extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("sort_by_visits", new Link('popular_images'), "Popular Posts");
diff --git a/ext/index/main.php b/ext/index/main.php
index 60010a26..b1fb37ce 100644
--- a/ext/index/main.php
+++ b/ext/index/main.php
@@ -16,7 +16,7 @@ class Index extends Extension
/** @var IndexTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int(IndexConfig::IMAGES, 24);
@@ -24,7 +24,7 @@ class Index extends Extension
$config->set_default_string(IndexConfig::ORDER, "id DESC");
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $config, $page, $user;
if ($event->page_matches("post/list")) {
@@ -122,7 +122,7 @@ class Index extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Index Options");
$sb->position = 20;
@@ -132,26 +132,26 @@ class Index extends Extension
$sb->add_label(" images on the post list");
}
- public function onPageNavBuilding(PageNavBuildingEvent $event)
+ public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("posts", new Link('post/list'), "Posts", NavLink::is_active(["post","view"]), 20);
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("posts_all", new Link('post/list'), "All");
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$event->add_block(new Block("General", $this->theme->get_help_html()), 0);
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('search')
->addArgument('query', InputArgument::REQUIRED)
@@ -166,7 +166,7 @@ class Index extends Extension
});
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
diff --git a/ext/ipban/main.php b/ext/ipban/main.php
index 60561cf7..1def39ee 100644
--- a/ext/ipban/main.php
+++ b/ext/ipban/main.php
@@ -88,7 +88,7 @@ class IPBan extends Extension
return 10;
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string(
@@ -100,7 +100,7 @@ class IPBan extends Extension
);
}
- public function onUserLogin(UserLoginEvent $event)
+ public function onUserLogin(UserLoginEvent $event): void
{
global $cache, $config, $database, $page, $_shm_user_classes;
@@ -177,7 +177,7 @@ class IPBan extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("ip_ban")) {
global $database, $page, $user;
@@ -210,7 +210,7 @@ class IPBan extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $config;
@@ -224,7 +224,7 @@ class IPBan extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -234,7 +234,7 @@ class IPBan extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IP)) {
@@ -242,7 +242,7 @@ class IPBan extends Extension
}
}
- public function onAddIPBan(AddIPBanEvent $event)
+ public function onAddIPBan(AddIPBanEvent $event): void
{
global $cache, $user, $database;
$sql = "INSERT INTO bans (ip, mode, reason, expires, banner_id) VALUES (:ip, :mode, :reason, :expires, :admin_id)";
@@ -252,7 +252,7 @@ class IPBan extends Extension
log_info("ipban", "Banned ({$event->mode}) {$event->ip} because '{$event->reason}' until {$event->expires}");
}
- public function onRemoveIPBan(RemoveIPBanEvent $event)
+ public function onRemoveIPBan(RemoveIPBanEvent $event): void
{
global $cache, $database;
$ban = $database->get_row("SELECT * FROM bans WHERE id = :id", ["id" => $event->id]);
@@ -264,7 +264,7 @@ class IPBan extends Extension
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
diff --git a/ext/link_image/main.php b/ext/link_image/main.php
index cb56b787..4255a50e 100644
--- a/ext/link_image/main.php
+++ b/ext/link_image/main.php
@@ -9,19 +9,19 @@ class LinkImage extends Extension
/** @var LinkImageTheme */
protected Themelet $theme;
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
$this->theme->links_block($page, $this->data($event->image));
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Link to Post");
$sb->add_text_option("ext_link-img_text-link_format", "Text Link Format: ");
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("ext_link-img_text-link_format", '$title - $id ($ext $size $filesize)');
diff --git a/ext/livefeed/main.php b/ext/livefeed/main.php
index fbc1369a..cf5e8018 100644
--- a/ext/livefeed/main.php
+++ b/ext/livefeed/main.php
@@ -6,18 +6,18 @@ namespace Shimmie2;
class LiveFeed extends Extension
{
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Live Feed");
$sb->add_text_option("livefeed_host", "IP:port to send events to: ");
}
- public function onUserCreation(UserCreationEvent $event)
+ public function onUserCreation(UserCreationEvent $event): void
{
$this->msg("New user created: {$event->username}");
}
- public function onImageAddition(ImageAdditionEvent $event)
+ public function onImageAddition(ImageAdditionEvent $event): void
{
global $user;
$this->msg(
@@ -26,7 +26,7 @@ class LiveFeed extends Extension
);
}
- public function onTagSet(TagSetEvent $event)
+ public function onTagSet(TagSetEvent $event): void
{
$this->msg(
make_http(make_link("post/view/".$event->image->id))." - ".
@@ -34,7 +34,7 @@ class LiveFeed extends Extension
);
}
- public function onCommentPosting(CommentPostingEvent $event)
+ public function onCommentPosting(CommentPostingEvent $event): void
{
global $user;
$this->msg(
diff --git a/ext/log_console/main.php b/ext/log_console/main.php
index 5ff8b358..1170becf 100644
--- a/ext/log_console/main.php
+++ b/ext/log_console/main.php
@@ -6,7 +6,7 @@ namespace Shimmie2;
class LogConsole extends Extension
{
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool("log_console_access", true);
@@ -14,7 +14,7 @@ class LogConsole extends Extension
$config->set_default_int("log_console_level", SCORE_LOG_INFO);
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
@@ -40,7 +40,7 @@ class LogConsole extends Extension
*/
}
- public function onLog(LogEvent $event)
+ public function onLog(LogEvent $event): void
{
global $config;
if ($event->priority >= $config->get_int("log_console_level")) {
diff --git a/ext/log_db/main.php b/ext/log_db/main.php
index 3ee12299..e38a7c9e 100644
--- a/ext/log_db/main.php
+++ b/ext/log_db/main.php
@@ -230,13 +230,13 @@ class LogDatabase extends Extension
/** @var LogDatabaseTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("log_db_priority", SCORE_LOG_INFO);
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -255,7 +255,7 @@ class LogDatabase extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Logging (Database)");
$sb->add_choice_option("log_db_priority", [
@@ -267,7 +267,7 @@ class LogDatabase extends Extension
], "Debug Level: ");
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $database, $user;
if ($event->page_matches("log/view")) {
@@ -279,7 +279,7 @@ class LogDatabase extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -289,7 +289,7 @@ class LogDatabase extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_EVENTLOG)) {
@@ -297,7 +297,7 @@ class LogDatabase extends Extension
}
}
- public function onLog(LogEvent $event)
+ public function onLog(LogEvent $event): void
{
global $config, $database, $user;
diff --git a/ext/log_logstash/main.php b/ext/log_logstash/main.php
index 1ad6f5fb..bb10adf6 100644
--- a/ext/log_logstash/main.php
+++ b/ext/log_logstash/main.php
@@ -6,13 +6,13 @@ namespace Shimmie2;
class LogLogstash extends Extension
{
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("log_logstash_host", "127.0.0.1:1234");
}
- public function onLog(LogEvent $event)
+ public function onLog(LogEvent $event): void
{
global $user;
diff --git a/ext/log_net/main.php b/ext/log_net/main.php
index 1fec2607..e35f8cbf 100644
--- a/ext/log_net/main.php
+++ b/ext/log_net/main.php
@@ -8,13 +8,13 @@ class LogNet extends Extension
{
private int $count = 0;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("log_net_host", "127.0.0.1:35353");
}
- public function onLog(LogEvent $event)
+ public function onLog(LogEvent $event): void
{
global $user;
diff --git a/ext/media/main.php b/ext/media/main.php
index 81884f75..3014e62e 100644
--- a/ext/media/main.php
+++ b/ext/media/main.php
@@ -61,7 +61,7 @@ class Media extends Extension
return 30;
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string(MediaConfig::FFPROBE_PATH, 'ffprobe');
@@ -70,7 +70,7 @@ class Media extends Extension
$config->set_default_string(MediaConfig::CONVERT_PATH, 'convert');
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@@ -85,7 +85,7 @@ class Media extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Media Engine Commands");
@@ -110,7 +110,7 @@ class Media extends Extension
$sb->end_table();
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::DELETE_IMAGE)) {
@@ -118,7 +118,7 @@ class Media extends Extension
}
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::RESCAN_MEDIA)) {
@@ -126,7 +126,7 @@ class Media extends Extension
}
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@@ -151,7 +151,7 @@ class Media extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('media-rescan')
->addArgument('id_or_hash', InputArgument::REQUIRED)
@@ -174,7 +174,7 @@ class Media extends Extension
* @throws MediaException
* @throws InsufficientMemoryException
*/
- public function onMediaResize(MediaResizeEvent $event)
+ public function onMediaResize(MediaResizeEvent $event): void
{
if (!in_array(
$event->resize_type,
@@ -237,7 +237,7 @@ class Media extends Extension
public const CONTENT_SEARCH_TERM_REGEX = "/^content[=|:]((video)|(audio)|(image)|(unknown))$/i";
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@@ -254,7 +254,7 @@ class Media extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@@ -264,14 +264,14 @@ class Media extends Extension
}
}
- public function onTagTermCheck(TagTermCheckEvent $event)
+ public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match(self::CONTENT_SEARCH_TERM_REGEX, $event->term)) {
$event->metatag = true;
}
}
- public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
+ public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
if ($event->image->width && $event->image->height && $event->image->length) {
$s = ((int)($event->image->length / 100)) / 10;
@@ -867,7 +867,7 @@ class Media extends Extension
return $size;
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;
if ($this->get_version(MediaConfig::VERSION) < 1) {
diff --git a/ext/mime/main.php b/ext/mime/main.php
index dbd1eb69..c093d0c5 100644
--- a/ext/mime/main.php
+++ b/ext/mime/main.php
@@ -15,14 +15,14 @@ class MimeSystem extends Extension
public const VERSION = "ext_mime_version";
- public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
+ public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$event->replace('$ext', $event->image->get_ext());
$event->replace('$mime', $event->image->get_mime());
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -58,7 +58,7 @@ class MimeSystem extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@@ -68,7 +68,7 @@ class MimeSystem extends Extension
}
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
diff --git a/ext/not_a_tag/main.php b/ext/not_a_tag/main.php
index 57e3a6d7..8caf42ce 100644
--- a/ext/not_a_tag/main.php
+++ b/ext/not_a_tag/main.php
@@ -40,7 +40,7 @@ class NotATag extends Extension
return 30;
} // before ImageUploadEvent and tag_history
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
if ($this->get_version("ext_notatag_version") < 1) {
@@ -52,7 +52,7 @@ class NotATag extends Extension
}
}
- public function onTagSet(TagSetEvent $event)
+ public function onTagSet(TagSetEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IMAGE)) {
@@ -106,7 +106,7 @@ class NotATag extends Extension
return $ok_tags;
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "tags") {
@@ -116,7 +116,7 @@ class NotATag extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IMAGE)) {
@@ -124,7 +124,7 @@ class NotATag extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;
diff --git a/ext/notes/main.php b/ext/notes/main.php
index f190e374..84a85173 100644
--- a/ext/notes/main.php
+++ b/ext/notes/main.php
@@ -9,7 +9,7 @@ class Notes extends Extension
/** @var NotesTheme */
protected Themelet $theme;
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;
@@ -70,7 +70,7 @@ class Notes extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("note")) {
@@ -162,7 +162,7 @@ class Notes extends Extension
/*
* HERE WE LOAD THE NOTES IN THE IMAGE
*/
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page, $user;
@@ -175,7 +175,7 @@ class Notes extends Extension
/*
* HERE WE ADD THE BUTTONS ON SIDEBAR
*/
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if (!$user->is_anonymous()) {
@@ -192,7 +192,7 @@ class Notes extends Extension
/*
* HERE WE ADD QUERYLETS TO ADD SEARCH SYSTEM
*/
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@@ -215,7 +215,7 @@ class Notes extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php
index 7f8f3f63..1824969a 100644
--- a/ext/numeric_score/main.php
+++ b/ext/numeric_score/main.php
@@ -104,7 +104,7 @@ class NumericScore extends Extension
/** @var NumericScoreTheme */
protected Themelet $theme;
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $user;
if ($user->can(Permissions::CREATE_VOTE)) {
@@ -112,7 +112,7 @@ class NumericScore extends Extension
}
}
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_OTHER_VOTE)) {
@@ -126,7 +126,7 @@ class NumericScore extends Extension
$event->add_stats("$n_up Upvotes / $n_down Downvotes");
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $user, $page;
@@ -230,20 +230,20 @@ class NumericScore extends Extension
}
}
- public function onNumericScoreSet(NumericScoreSetEvent $event)
+ public function onNumericScoreSet(NumericScoreSetEvent $event): void
{
global $user;
log_debug("numeric_score", "Rated >>{$event->image_id} as {$event->score}", "Rated Post");
$this->add_vote($event->image_id, $user->id, $event->score);
}
- public function onImageDeletion(ImageDeletionEvent $event)
+ public function onImageDeletion(ImageDeletionEvent $event): void
{
global $database;
$database->execute("DELETE FROM numeric_score_votes WHERE image_id=:id", ["id" => $event->image->id]);
}
- public function onUserDeletion(UserDeletionEvent $event)
+ public function onUserDeletion(UserDeletionEvent $event): void
{
$this->delete_votes_by($event->id);
}
@@ -280,12 +280,12 @@ class NumericScore extends Extension
}
}
- public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
+ public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$event->replace('$score', (string)$event->image->numeric_score);
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@@ -295,7 +295,7 @@ class NumericScore extends Extension
}
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@@ -347,14 +347,14 @@ class NumericScore extends Extension
}
}
- public function onTagTermCheck(TagTermCheckEvent $event)
+ public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match("/^vote[=|:](up|down|remove)$/i", $event->term)) {
$event->metatag = true;
}
}
- public function onTagTermParse(TagTermParseEvent $event)
+ public function onTagTermParse(TagTermParseEvent $event): void
{
$matches = [];
@@ -367,7 +367,7 @@ class NumericScore extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("numeric_score_day", new Link('popular_by_day'), "Popular by Day");
@@ -376,7 +376,7 @@ class NumericScore extends Extension
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
diff --git a/ext/ouroboros_api/main.php b/ext/ouroboros_api/main.php
index bb8bec0f..1b751d60 100644
--- a/ext/ouroboros_api/main.php
+++ b/ext/ouroboros_api/main.php
@@ -234,7 +234,7 @@ class OuroborosAPI extends Extension
public const ERROR_POST_CREATE_DUPE = 'Duplicate';
public const OK_POST_CREATE_UPDATE = 'Updated';
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
diff --git a/ext/pm/main.php b/ext/pm/main.php
index 4ff47a68..aeb19423 100644
--- a/ext/pm/main.php
+++ b/ext/pm/main.php
@@ -143,7 +143,7 @@ class PrivMsg extends Extension
/** @var PrivMsgTheme */
protected Themelet $theme;
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -181,7 +181,7 @@ class PrivMsg extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "user") {
@@ -193,7 +193,7 @@ class PrivMsg extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::READ_PM)) {
@@ -203,7 +203,7 @@ class PrivMsg extends Extension
}
}
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $page, $user;
$duser = $event->display_user;
@@ -218,7 +218,7 @@ class PrivMsg extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $database, $page, $user;
if ($event->page_matches("pm")) {
@@ -283,7 +283,7 @@ class PrivMsg extends Extension
}
}
- public function onSendPM(SendPMEvent $event)
+ public function onSendPM(SendPMEvent $event): void
{
global $cache, $database;
$database->execute(
diff --git a/ext/pools/main.php b/ext/pools/main.php
index 8ae35728..662f0136 100644
--- a/ext/pools/main.php
+++ b/ext/pools/main.php
@@ -121,7 +121,7 @@ class Pools extends Extension
/** @var PoolsTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
@@ -136,7 +136,7 @@ class Pools extends Extension
$config->set_default_bool(PoolsConfig::AUTO_INCREMENT_ORDER, false);
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -183,7 +183,7 @@ class Pools extends Extension
}
// Add a block to the Board Config / Setup
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Pools");
$sb->add_int_option(PoolsConfig::MAX_IMPORT_RESULTS, "Max results on import: ");
@@ -196,12 +196,12 @@ class Pools extends Extension
//$sb->add_bool_option(PoolsConfig::ADDER_ON_VIEW_IMAGE, "
Show pool adder on image: ");
}
- public function onPageNavBuilding(PageNavBuildingEvent $event)
+ public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("pool", new Link('pool/list'), "Pools");
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "pool") {
$event->add_nav_link("pool_list", new Link('pool/list'), "List");
@@ -211,7 +211,7 @@ class Pools extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page, $user;
if ($event->page_matches("pool/list")) { //index
@@ -442,7 +442,7 @@ class Pools extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
$event->add_link("Pools", make_link("pool/list"));
}
@@ -452,7 +452,7 @@ class Pools extends Extension
* image is currently a member of on a side panel, as well as a link
* to the Next image in the pool.
*/
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $config;
@@ -475,7 +475,7 @@ class Pools extends Extension
}
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $config, $database, $user;
if ($config->get_bool(PoolsConfig::ADDER_ON_VIEW_IMAGE) && !$user->is_anonymous()) {
@@ -491,14 +491,14 @@ class Pools extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$event->add_block(new Block("Pools", $this->theme->get_help_html()));
}
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@@ -530,14 +530,14 @@ class Pools extends Extension
}
- public function onTagTermCheck(TagTermCheckEvent $event)
+ public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match("/^pool[=|:]([^:]*|lastcreated):?([0-9]*)$/i", $event->term)) {
$event->metatag = true;
}
}
- public function onTagTermParse(TagTermParseEvent $event)
+ public function onTagTermParse(TagTermParseEvent $event): void
{
$matches = [];
if (preg_match("/^pool[=|:]([^:]*|lastcreated):?([0-9]*)$/i", $event->term, $matches)) {
@@ -560,7 +560,7 @@ class Pools extends Extension
}
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $database;
@@ -571,7 +571,7 @@ class Pools extends Extension
$event->add_action("bulk_pool_add_new", "Create Pool", "", "", (string)$this->theme->get_bulk_pool_input($event->search_terms));
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $user;
@@ -658,7 +658,7 @@ class Pools extends Extension
$this->theme->list_pools($page, $pools, $search, $pageNumber + 1, $totalPages);
}
- public function onPoolCreation(PoolCreationEvent $event)
+ public function onPoolCreation(PoolCreationEvent $event): void
{
global $user, $database;
@@ -728,7 +728,7 @@ class Pools extends Extension
/**
* HERE WE ADD CHECKED IMAGES FROM POOL AND UPDATE THE HISTORY
*/
- public function onPoolAddPosts(PoolAddPostsEvent $event)
+ public function onPoolAddPosts(PoolAddPostsEvent $event): void
{
global $database, $user;
@@ -856,7 +856,7 @@ class Pools extends Extension
/**
* HERE WE NUKE ENTIRE POOL. WE REMOVE POOLS AND POSTS FROM REMOVED POOL AND HISTORIES ENTRIES FROM REMOVED POOL.
*/
- public function onPoolDeletion(PoolDeletionEvent $event)
+ public function onPoolDeletion(PoolDeletionEvent $event): void
{
global $user, $database;
$poolID = $event->pool_id;
diff --git a/ext/post_titles/main.php b/ext/post_titles/main.php
index d4ff1698..074540c8 100644
--- a/ext/post_titles/main.php
+++ b/ext/post_titles/main.php
@@ -17,7 +17,7 @@ class PostTitles extends Extension
return 60;
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
@@ -25,7 +25,7 @@ class PostTitles extends Extension
$config->set_default_bool(PostTitlesConfig::SHOW_IN_WINDOW_TITLE, false);
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -35,7 +35,7 @@ class PostTitles extends Extension
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $config, $page;
@@ -44,14 +44,14 @@ class PostTitles extends Extension
}
}
- public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
+ public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $user;
$event->add_part($this->theme->get_title_set_html(self::get_title($event->image), $user->can(Permissions::EDIT_IMAGE_TITLE)), 10);
}
- public function onImageInfoSet(ImageInfoSetEvent $event)
+ public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
@@ -61,12 +61,12 @@ class PostTitles extends Extension
}
}
- public function onPostTitleSet(PostTitleSetEvent $event)
+ public function onPostTitleSet(PostTitleSetEvent $event): void
{
$this->set_title($event->image->id, $event->title);
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Post Titles");
$sb->start_table();
@@ -75,11 +75,11 @@ class PostTitles extends Extension
$sb->end_table();
}
- public function onBulkExport(BulkExportEvent $event)
+ public function onBulkExport(BulkExportEvent $event): void
{
$event->fields["title"] = $event->image->title;
}
- public function onBulkImport(BulkImportEvent $event)
+ public function onBulkImport(BulkImportEvent $event): void
{
if (array_key_exists("title", $event->fields) && $event->fields['title'] != null) {
$this->set_title($event->image->id, $event->fields['title']);
diff --git a/ext/private_image/main.php b/ext/private_image/main.php
index ae154ddd..a4a8c25b 100644
--- a/ext/private_image/main.php
+++ b/ext/private_image/main.php
@@ -16,18 +16,18 @@ class PrivateImage extends Extension
/** @var PrivateImageTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
Image::$bool_props[] = "private";
}
- public function onInitUserConfig(InitUserConfigEvent $event)
+ public function onInitUserConfig(InitUserConfigEvent $event): void
{
$event->user_config->set_default_bool(PrivateImageConfig::USER_SET_DEFAULT, false);
$event->user_config->set_default_bool(PrivateImageConfig::USER_VIEW_DEFAULT, true);
}
- public function onUserOptionsBuilding(UserOptionsBuildingEvent $event)
+ public function onUserOptionsBuilding(UserOptionsBuildingEvent $event): void
{
global $user;
$sb = $event->panel->create_new_block("Private Posts");
@@ -39,7 +39,7 @@ class PrivateImage extends Extension
$sb->end_table();
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user, $user_config;
@@ -113,7 +113,7 @@ class PrivateImage extends Extension
}
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $user, $page;
@@ -125,7 +125,7 @@ class PrivateImage extends Extension
public const SEARCH_REGEXP = "/^private:(yes|no|any)/";
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
global $user, $user_config;
$show_private = $user_config->get_bool(PrivateImageConfig::USER_VIEW_DEFAULT);
@@ -180,7 +180,7 @@ class PrivateImage extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@@ -221,7 +221,7 @@ class PrivateImage extends Extension
);
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if (($user->can(Permissions::SET_PRIVATE_IMAGE) && $user->id == $event->image->owner_id) || $user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
@@ -229,7 +229,7 @@ class PrivateImage extends Extension
}
}
- public function onImageAddition(ImageAdditionEvent $event)
+ public function onImageAddition(ImageAdditionEvent $event): void
{
global $user, $user_config;
if ($user_config->get_bool(PrivateImageConfig::USER_SET_DEFAULT) && $user->can(Permissions::SET_PRIVATE_IMAGE)) {
@@ -237,7 +237,7 @@ class PrivateImage extends Extension
}
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@@ -247,7 +247,7 @@ class PrivateImage extends Extension
}
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@@ -278,7 +278,7 @@ class PrivateImage extends Extension
break;
}
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
diff --git a/ext/qr_code/main.php b/ext/qr_code/main.php
index 22468c8c..f9ceafb4 100644
--- a/ext/qr_code/main.php
+++ b/ext/qr_code/main.php
@@ -9,7 +9,7 @@ class QRImage extends Extension
/** @var QRImageTheme */
protected Themelet $theme;
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
$this->theme->links_block(make_http(make_link('image/'.$event->image->id.'.'.$event->image->get_ext())));
}
diff --git a/ext/random_image/main.php b/ext/random_image/main.php
index 75951215..0e43ae91 100644
--- a/ext/random_image/main.php
+++ b/ext/random_image/main.php
@@ -9,7 +9,7 @@ class RandomImage extends Extension
/** @var RandomImageTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page;
@@ -40,13 +40,13 @@ class RandomImage extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Random Post");
$sb->add_bool_option("show_random_block", "Show Random Block: ");
}
- public function onPostListBuilding(PostListBuildingEvent $event)
+ public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $config, $page;
if ($config->get_bool("show_random_block")) {
@@ -57,7 +57,7 @@ class RandomImage extends Extension
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("posts_random", new Link('random_image/view'), "Random Post");
diff --git a/ext/random_list/main.php b/ext/random_list/main.php
index a8c07ba3..693ba43d 100644
--- a/ext/random_list/main.php
+++ b/ext/random_list/main.php
@@ -9,7 +9,7 @@ class RandomList extends Extension
/** @var RandomListTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
@@ -53,13 +53,13 @@ class RandomList extends Extension
}
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("random_images_list_count", 12);
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Random Posts List");
@@ -70,7 +70,7 @@ class RandomList extends Extension
);
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("posts_random", new Link('random'), "Shuffle");
diff --git a/ext/rating/main.php b/ext/rating/main.php
index dc954788..f01a1413 100644
--- a/ext/rating/main.php
+++ b/ext/rating/main.php
@@ -79,7 +79,7 @@ class Ratings extends Extension
private string $search_regexp;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config, $_shm_user_classes, $_shm_ratings;
@@ -110,12 +110,12 @@ class Ratings extends Extension
return true;
}
- public function onInitUserConfig(InitUserConfigEvent $event)
+ public function onInitUserConfig(InitUserConfigEvent $event): void
{
$event->user_config->set_default_array(RatingsConfig::USER_DEFAULTS, self::get_user_class_privs($event->user));
}
- public function onImageDownloading(ImageDownloadingEvent $event)
+ public function onImageDownloading(ImageDownloadingEvent $event): void
{
/**
* Deny images upon insufficient permissions.
@@ -125,7 +125,7 @@ class Ratings extends Extension
}
}
- public function onUserOptionsBuilding(UserOptionsBuildingEvent $event)
+ public function onUserOptionsBuilding(UserOptionsBuildingEvent $event): void
{
global $user, $_shm_ratings;
@@ -142,7 +142,7 @@ class Ratings extends Extension
$sb->add_label("This controls the default rating search results will be filtered by, and nothing else. To override in your search results, add rating:* to your search.");
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $_shm_user_classes;
@@ -164,14 +164,14 @@ class Ratings extends Extension
$sb->end_table();
}
- public function onImageAddition(ImageAdditionEvent $event)
+ public function onImageAddition(ImageAdditionEvent $event): void
{
if(!empty($event->metadata['rating'])) {
send_event(new RatingSetEvent($event->image, $event->metadata['rating']));
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
/**
@@ -183,11 +183,11 @@ class Ratings extends Extension
}
}
- public function onBulkExport(BulkExportEvent $event)
+ public function onBulkExport(BulkExportEvent $event): void
{
$event->fields["rating"] = $event->image->rating;
}
- public function onBulkImport(BulkImportEvent $event)
+ public function onBulkImport(BulkImportEvent $event): void
{
if (array_key_exists("rating", $event->fields)
&& $event->fields['rating'] !== null
@@ -196,7 +196,7 @@ class Ratings extends Extension
}
}
- public function onRatingSet(RatingSetEvent $event)
+ public function onRatingSet(RatingSetEvent $event): void
{
if (empty($event->image->rating)) {
$old_rating = "";
@@ -206,7 +206,7 @@ class Ratings extends Extension
$this->set_rating($event->image->id, $event->rating, $old_rating);
}
- public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
+ public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $user;
$event->add_part(
@@ -219,7 +219,7 @@ class Ratings extends Extension
);
}
- public function onImageInfoSet(ImageInfoSetEvent $event)
+ public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_RATING) && isset($_POST["rating"])) {
@@ -230,14 +230,14 @@ class Ratings extends Extension
}
}
- public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
+ public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
if(!is_null($event->image->rating)) {
$event->replace('$rating', $this->rating_to_human($event->image->rating));
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$ratings = self::get_sorted_ratings();
@@ -245,7 +245,7 @@ class Ratings extends Extension
}
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
global $user;
@@ -277,14 +277,14 @@ class Ratings extends Extension
}
}
- public function onTagTermCheck(TagTermCheckEvent $event)
+ public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match($this->search_regexp, $event->term)) {
$event->metatag = true;
}
}
- public function onTagTermParse(TagTermParseEvent $event)
+ public function onTagTermParse(TagTermParseEvent $event): void
{
global $user;
$matches = [];
@@ -303,7 +303,7 @@ class Ratings extends Extension
}
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
global $database, $_shm_ratings;
@@ -320,7 +320,7 @@ class Ratings extends Extension
$this->theme->display_form($original_values);
}
- public function onAdminAction(AdminActionEvent $event)
+ public function onAdminAction(AdminActionEvent $event): void
{
global $database, $user;
$action = $event->action;
@@ -344,7 +344,7 @@ class Ratings extends Extension
}
}
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@@ -353,7 +353,7 @@ class Ratings extends Extension
}
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@@ -375,7 +375,7 @@ class Ratings extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $user, $page;
@@ -504,7 +504,7 @@ class Ratings extends Extension
return true;
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database, $config;
diff --git a/ext/regen_thumb/main.php b/ext/regen_thumb/main.php
index 5067ab71..8c93604d 100644
--- a/ext/regen_thumb/main.php
+++ b/ext/regen_thumb/main.php
@@ -17,7 +17,7 @@ class RegenThumb extends Extension
return $event->generated;
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@@ -41,7 +41,7 @@ class RegenThumb extends Extension
}
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::DELETE_IMAGE)) {
@@ -49,7 +49,7 @@ class RegenThumb extends Extension
}
}
- // public function onPostListBuilding(PostListBuildingEvent $event)
+ // public function onPostListBuilding(PostListBuildingEvent $event): void
// {
// global $user;
// if ($user->can(UserAbilities::DELETE_IMAGE) && !empty($event->search_terms)) {
@@ -57,7 +57,7 @@ class RegenThumb extends Extension
// }
// }
- public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
+ public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@@ -66,7 +66,7 @@ class RegenThumb extends Extension
}
}
- public function onBulkAction(BulkActionEvent $event)
+ public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@@ -91,12 +91,12 @@ class RegenThumb extends Extension
}
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
- public function onAdminAction(AdminActionEvent $event)
+ public function onAdminAction(AdminActionEvent $event): void
{
global $page;
switch ($event->action) {
diff --git a/ext/relationships/main.php b/ext/relationships/main.php
index 80f5183b..e21a28d9 100644
--- a/ext/relationships/main.php
+++ b/ext/relationships/main.php
@@ -25,13 +25,13 @@ class Relationships extends Extension
public const NAME = "Relationships";
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
Image::$bool_props[] = "has_children";
Image::$int_props[] = "parent_id";
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -52,7 +52,7 @@ class Relationships extends Extension
}
}
- public function onImageInfoSet(ImageInfoSetEvent $event)
+ public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_RELATIONSHIPS)) {
@@ -66,12 +66,12 @@ class Relationships extends Extension
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
$this->theme->relationship_info($event->image);
}
- public function onSearchTermParse(SearchTermParseEvent $event)
+ public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@@ -93,7 +93,7 @@ class Relationships extends Extension
}
}
- public function onHelpPageBuilding(HelpPageBuildingEvent $event)
+ public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@@ -103,14 +103,14 @@ class Relationships extends Extension
}
}
- public function onTagTermCheck(TagTermCheckEvent $event)
+ public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match("/^(parent|child)[=|:](.*)$/i", $event->term)) {
$event->metatag = true;
}
}
- public function onTagTermParse(TagTermParseEvent $event)
+ public function onTagTermParse(TagTermParseEvent $event): void
{
$matches = [];
@@ -127,12 +127,12 @@ class Relationships extends Extension
}
}
- public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
+ public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
$event->add_part($this->theme->get_parent_editor_html($event->image), 45);
}
- public function onImageDeletion(ImageDeletionEvent $event)
+ public function onImageDeletion(ImageDeletionEvent $event): void
{
global $database;
@@ -145,7 +145,7 @@ class Relationships extends Extension
}
}
- public function onImageRelationshipSet(ImageRelationshipSetEvent $event)
+ public function onImageRelationshipSet(ImageRelationshipSetEvent $event): void
{
global $database;
diff --git a/ext/replace_file/main.php b/ext/replace_file/main.php
index dcd80296..6788dfa2 100644
--- a/ext/replace_file/main.php
+++ b/ext/replace_file/main.php
@@ -9,7 +9,7 @@ class ReplaceFile extends Extension
/** @var ReplaceFileTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $page, $user;
@@ -45,7 +45,7 @@ class ReplaceFile extends Extension
}
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
@@ -55,7 +55,7 @@ class ReplaceFile extends Extension
}
}
- public function onImageReplace(ImageReplaceEvent $event)
+ public function onImageReplace(ImageReplaceEvent $event): void
{
$image = $event->image;
diff --git a/ext/report_image/main.php b/ext/report_image/main.php
index 9a65758a..a29e593d 100644
--- a/ext/report_image/main.php
+++ b/ext/report_image/main.php
@@ -45,7 +45,7 @@ class ReportImage extends Extension
/** @var ReportImageTheme */
protected Themelet $theme;
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("image_report")) {
@@ -82,7 +82,7 @@ class ReportImage extends Extension
}
}
- public function onAddReportedImage(AddReportedImageEvent $event)
+ public function onAddReportedImage(AddReportedImageEvent $event): void
{
global $cache, $database;
log_info("report_image", "Adding report of >>{$event->report->image_id} with reason '{$event->report->reason}'");
@@ -94,14 +94,14 @@ class ReportImage extends Extension
$cache->delete("image-report-count");
}
- public function onRemoveReportedImage(RemoveReportedImageEvent $event)
+ public function onRemoveReportedImage(RemoveReportedImageEvent $event): void
{
global $cache, $database;
$database->execute("DELETE FROM image_reports WHERE id = :id", ["id" => $event->id]);
$cache->delete("image-report-count");
}
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
@@ -109,7 +109,7 @@ class ReportImage extends Extension
}
}
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $user;
if ($user->can(Permissions::CREATE_IMAGE_REPORT)) {
@@ -119,7 +119,7 @@ class ReportImage extends Extension
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -132,7 +132,7 @@ class ReportImage extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
@@ -142,19 +142,19 @@ class ReportImage extends Extension
}
}
- public function onImageDeletion(ImageDeletionEvent $event)
+ public function onImageDeletion(ImageDeletionEvent $event): void
{
global $cache, $database;
$database->execute("DELETE FROM image_reports WHERE image_id = :image_id", ["image_id" => $event->image->id]);
$cache->delete("image-report-count");
}
- public function onUserDeletion(UserDeletionEvent $event)
+ public function onUserDeletion(UserDeletionEvent $event): void
{
$this->delete_reports_by($event->id);
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Post Reports");
@@ -174,7 +174,7 @@ class ReportImage extends Extension
$cache->delete("image-report-count");
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
diff --git a/ext/res_limit/main.php b/ext/res_limit/main.php
index 8b9c470b..c5c4bea6 100644
--- a/ext/res_limit/main.php
+++ b/ext/res_limit/main.php
@@ -11,7 +11,7 @@ class ResolutionLimit extends Extension
return 40;
} // early, to veto ImageUploadEvent
- public function onImageAddition(ImageAdditionEvent $event)
+ public function onImageAddition(ImageAdditionEvent $event): void
{
global $config;
$min_w = $config->get_int("upload_min_width", -1);
@@ -60,7 +60,7 @@ class ResolutionLimit extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Resolution Limits");
diff --git a/ext/resize/main.php b/ext/resize/main.php
index e97502dd..92c279f8 100644
--- a/ext/resize/main.php
+++ b/ext/resize/main.php
@@ -31,7 +31,7 @@ class ResizeImage extends Extension
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool(ResizeConfig::ENABLED, true);
@@ -42,7 +42,7 @@ class ResizeImage extends Extension
$config->set_default_int(ResizeConfig::DEFAULT_HEIGHT, 0);
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user, $config;
if ($user->can(Permissions::EDIT_FILES) && $config->get_bool(ResizeConfig::ENABLED)
@@ -52,7 +52,7 @@ class ResizeImage extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Image Resize");
$sb->start_table();
@@ -73,7 +73,7 @@ class ResizeImage extends Extension
$sb->end_table();
}
- public function onDataUpload(DataUploadEvent $event)
+ public function onDataUpload(DataUploadEvent $event): void
{
global $config, $page;
@@ -117,7 +117,7 @@ class ResizeImage extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@@ -164,7 +164,7 @@ class ResizeImage extends Extension
}
}
- public function onImageDownloading(ImageDownloadingEvent $event)
+ public function onImageDownloading(ImageDownloadingEvent $event): void
{
global $config, $user;
diff --git a/ext/reverse_search_links/main.php b/ext/reverse_search_links/main.php
index 07a961b6..62a09302 100644
--- a/ext/reverse_search_links/main.php
+++ b/ext/reverse_search_links/main.php
@@ -17,7 +17,7 @@ class ReverseSearchLinks extends Extension
/**
* Show the extension block when viewing an image
*/
- public function onDisplayingImage(DisplayingImageEvent $event)
+ public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
@@ -56,7 +56,7 @@ class ReverseSearchLinks extends Extension
/**
* Set default config values
*/
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_array(
diff --git a/ext/rotate/main.php b/ext/rotate/main.php
index 60bc6744..4073a4f2 100644
--- a/ext/rotate/main.php
+++ b/ext/rotate/main.php
@@ -23,14 +23,14 @@ class RotateImage extends Extension
public const SUPPORTED_MIME = [MimeType::JPEG, MimeType::PNG, MimeType::GIF, MimeType::WEBP];
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool('rotate_enabled', true);
$config->set_default_int('rotate_default_deg', 180);
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user, $config;
if ($user->can(Permissions::EDIT_FILES) && $config->get_bool("rotate_enabled")
@@ -40,7 +40,7 @@ class RotateImage extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Image Rotate");
$sb->add_bool_option("rotate_enabled", "Allow rotating images: ");
@@ -49,7 +49,7 @@ class RotateImage extends Extension
$sb->add_label(" deg");
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
diff --git a/ext/rss_comments/main.php b/ext/rss_comments/main.php
index 64e7b960..0204eb89 100644
--- a/ext/rss_comments/main.php
+++ b/ext/rss_comments/main.php
@@ -6,7 +6,7 @@ namespace Shimmie2;
class RSSComments extends Extension
{
- public function onPostListBuilding(PostListBuildingEvent $event)
+ public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $config, $page;
$title = $config->get_string(SetupConfig::TITLE);
@@ -15,7 +15,7 @@ class RSSComments extends Extension
"title=\"$title - Comments\" href=\"".make_link("rss/comments")."\" />");
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page;
if ($event->page_matches("rss/comments")) {
@@ -75,7 +75,7 @@ EOD;
}
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "comment") {
$event->add_nav_link("comment_rss", new Link('rss/comments'), "Feed");
diff --git a/ext/rss_images/main.php b/ext/rss_images/main.php
index 8d2ff352..634b589d 100644
--- a/ext/rss_images/main.php
+++ b/ext/rss_images/main.php
@@ -6,7 +6,7 @@ namespace Shimmie2;
class RSSImages extends Extension
{
- public function onPostListBuilding(PostListBuildingEvent $event)
+ public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $config, $page;
$title = $config->get_string(SetupConfig::TITLE);
@@ -21,7 +21,7 @@ class RSSImages extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("rss/images")) {
$search_terms = $event->get_search_terms();
@@ -41,7 +41,7 @@ class RSSImages extends Extension
}
}
- public function onImageInfoSet(ImageInfoSetEvent $event)
+ public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $cache;
$cache->delete("rss-item-image:{$event->image->id}");
@@ -129,7 +129,7 @@ class RSSImages extends Extension
return $data;
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("posts_rss", new Link('rss/images'), "Feed");
diff --git a/ext/rule34/main.php b/ext/rule34/main.php
index 96508e0d..7c7ca186 100644
--- a/ext/rule34/main.php
+++ b/ext/rule34/main.php
@@ -25,19 +25,19 @@ class Rule34 extends Extension
/** @var Rule34Theme */
protected Themelet $theme;
- public function onImageDeletion(ImageDeletionEvent $event)
+ public function onImageDeletion(ImageDeletionEvent $event): void
{
global $database;
$database->notify("shm_image_bans", $event->image->hash);
}
- public function onImageInfoSet(ImageInfoSetEvent $event)
+ public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $cache;
$cache->delete("thumb-block:{$event->image->id}");
}
- public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
+ public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $config;
$image_link = $config->get_string(ImageConfig::ILINK);
@@ -57,7 +57,7 @@ class Rule34 extends Extension
);
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
global $page;
$html = make_form(make_link("admin/cache_purge"), "POST");
@@ -67,7 +67,7 @@ class Rule34 extends Extension
$page->add_block(new Block("Cache Purger", $html));
}
- public function onUserPageBuilding(UserPageBuildingEvent $event)
+ public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $database, $user, $config;
if ($user->can(Permissions::CHANGE_SETTING) && $config->get_bool('r34_comic_integration')) {
@@ -76,7 +76,7 @@ class Rule34 extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('wipe-thumb-cache')
->addArgument('tags', InputArgument::REQUIRED)
@@ -92,7 +92,7 @@ class Rule34 extends Extension
});
}
- public function onSourceSet(SourceSetEvent $event)
+ public function onSourceSet(SourceSetEvent $event): void
{
// Maybe check for 404?
if (empty($event->source)) {
@@ -103,7 +103,7 @@ class Rule34 extends Extension
}
}
- public function onRobotsBuilding(RobotsBuildingEvent $event)
+ public function onRobotsBuilding(RobotsBuildingEvent $event): void
{
// robots should only check the canonical site, not mirrors
if ($_SERVER['HTTP_HOST'] != "rule34.paheal.net") {
@@ -111,7 +111,7 @@ class Rule34 extends Extension
}
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;
diff --git a/ext/s3/main.php b/ext/s3/main.php
index 5cc6ba5c..b83ba9b5 100644
--- a/ext/s3/main.php
+++ b/ext/s3/main.php
@@ -16,7 +16,7 @@ class S3 extends Extension
{
public int $synced = 0;
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $config;
@@ -27,7 +27,7 @@ class S3 extends Extension
$sb->add_text_option(S3Config::IMAGE_BUCKET, "
Image Bucket: ");
}
- public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
+ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@@ -41,7 +41,7 @@ class S3 extends Extension
}
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('s3:process')
->setDescription('Process the S3 queue')
@@ -91,7 +91,7 @@ class S3 extends Extension
});
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page, $user;
if ($event->page_matches("s3/sync")) {
@@ -109,7 +109,7 @@ class S3 extends Extension
}
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::DELETE_IMAGE)) {
@@ -121,23 +121,23 @@ class S3 extends Extension
}
}
- public function onImageAddition(ImageAdditionEvent $event)
+ public function onImageAddition(ImageAdditionEvent $event): void
{
// Tags aren't set at this point, let's wait for the TagSetEvent
// $this->sync_post($event->image);
}
- public function onTagSet(TagSetEvent $event)
+ public function onTagSet(TagSetEvent $event): void
{
$this->sync_post($event->image, $event->new_tags);
}
- public function onImageDeletion(ImageDeletionEvent $event)
+ public function onImageDeletion(ImageDeletionEvent $event): void
{
$this->remove_file($event->image->hash);
}
- public function onImageReplace(ImageReplaceEvent $event)
+ public function onImageReplace(ImageReplaceEvent $event): void
{
$this->remove_file($event->old_hash);
$this->sync_post($event->image);
diff --git a/ext/setup/main.php b/ext/setup/main.php
index 4809dd86..63a182b8 100644
--- a/ext/setup/main.php
+++ b/ext/setup/main.php
@@ -300,7 +300,7 @@ class Setup extends Extension
/** @var SetupTheme */
protected Themelet $theme;
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string(SetupConfig::TITLE, "Shimmie");
@@ -310,7 +310,7 @@ class Setup extends Extension
$config->set_default_bool(SetupConfig::WORD_WRAP, true);
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page, $user;
@@ -340,7 +340,7 @@ class Setup extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$themes = [];
foreach (glob("themes/*") as $theme_dirname) {
@@ -393,7 +393,7 @@ class Setup extends Extension
$sb->add_text_option("api_recaptcha_pubkey", "
Site key: ");
}
- public function onConfigSave(ConfigSaveEvent $event)
+ public function onConfigSave(ConfigSaveEvent $event): void
{
$config = $event->config;
foreach ($_POST as $_name => $junk) {
@@ -424,7 +424,7 @@ class Setup extends Extension
log_warning("setup", "Cache cleared");
}
- public function onCliGen(CliGenEvent $event)
+ public function onCliGen(CliGenEvent $event): void
{
$event->app->register('config:get')
->addArgument('key', InputArgument::REQUIRED)
@@ -446,7 +446,7 @@ class Setup extends Extension
});
}
- public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
+ public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@@ -456,7 +456,7 @@ class Setup extends Extension
}
}
- public function onUserBlockBuilding(UserBlockBuildingEvent $event)
+ public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::CHANGE_SETTING)) {
@@ -464,7 +464,7 @@ class Setup extends Extension
}
}
- public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
+ public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
global $config;
$event->replace('$base', $config->get_string('base_href'));
diff --git a/ext/site_description/main.php b/ext/site_description/main.php
index e0fe5218..fe2961cc 100644
--- a/ext/site_description/main.php
+++ b/ext/site_description/main.php
@@ -6,7 +6,7 @@ namespace Shimmie2;
class SiteDescription extends Extension
{
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
if (!empty($config->get_string("site_description"))) {
@@ -19,7 +19,7 @@ class SiteDescription extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Site Description");
$sb->add_text_option("site_description", "Description: ");
diff --git a/ext/sitemap/main.php b/ext/sitemap/main.php
index 0d08142b..31d20518 100644
--- a/ext/sitemap/main.php
+++ b/ext/sitemap/main.php
@@ -9,7 +9,7 @@ class XMLSitemap extends Extension
private string $sitemap_queue = "";
private string $sitemap_filepath = ""; // set onPageRequest
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("sitemap.xml")) {
global $config;
@@ -29,7 +29,7 @@ class XMLSitemap extends Extension
}
}
- public function onSetupBuilding(SetupBuildingEvent $event)
+ public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Sitemap");
diff --git a/ext/source_history/main.php b/ext/source_history/main.php
index aec6f193..158c5846 100644
--- a/ext/source_history/main.php
+++ b/ext/source_history/main.php
@@ -15,18 +15,18 @@ class SourceHistory extends Extension
return 40;
}
- public function onInitExt(InitExtEvent $event)
+ public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("history_limit", -1);
}
- public function onAdminBuilding(AdminBuildingEvent $event)
+ public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
- public function onPageRequest(PageRequestEvent $event)
+ public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@@ -51,12 +51,12 @@ class SourceHistory extends Extension
}
}
- public function onRobotsBuilding(RobotsBuildingEvent $event)
+ public function onRobotsBuilding(RobotsBuildingEvent $event): void
{
$event->add_disallow("source_history");
}
- public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
+ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
$event->add_part("