diff options
| author | 2025-09-30 16:59:41 -0400 | |
|---|---|---|
| committer | 2025-09-30 22:59:41 +0200 | |
| commit | 72884813e13596d211471482ffdc6d723ed678c9 (patch) | |
| tree | 043856f23bdcae7f9f88294c47c499657c2d05ff /app/Models/Feed.php | |
| parent | bf6e634e042b726edd97335ac36b2305f8101b3f (diff) | |
Add hook enums (#8036)
- add an enum to handle hook types (enum are available since PHP 8.1)
- change hook calls from string value to enum value
Diffstat (limited to 'app/Models/Feed.php')
| -rw-r--r-- | app/Models/Feed.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 2b29f7b22..112da1a00 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -255,7 +255,7 @@ class FreshRSS_Feed extends Minz_Model { $params = ''; if ($this->customFavicon()) { $current = $this->id . Minz_User::name(); - $hookParams = Minz_ExtensionManager::callHook('custom_favicon_hash', $this); + $hookParams = Minz_ExtensionManager::callHook(Minz_HookType::CustomFaviconHash, $this); $params = $hookParams !== null ? $hookParams : $current; } else { $params = $this->website(fallback: true) . $this->proxyParam(); @@ -579,9 +579,9 @@ class FreshRSS_Feed extends Minz_Model { // Do not use `$simplePie->enable_cache(false);` as it would prevent caching in multiuser context $this->clearCache(); } - Minz_ExtensionManager::callHook('simplepie_before_init', $simplePie, $this); + Minz_ExtensionManager::callHook(Minz_HookType::SimplepieBeforeInit, $simplePie, $this); $simplePieResult = $simplePie->init(); - Minz_ExtensionManager::callHook('simplepie_after_init', $simplePie, $this, $simplePieResult); + Minz_ExtensionManager::callHook(Minz_HookType::SimplepieAfterInit, $simplePie, $this, $simplePieResult); if ($simplePieResult === false || $simplePie->get_hash() === '' || !empty($simplePie->error())) { if ($simplePie->status_code() === 429) { |
