Skip to content

Commit

Permalink
Better syntax for registerHook
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkarex committed Apr 7, 2024
1 parent cc6bf0d commit 55ae636
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions xExtension-ImageProxy/extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ public function init(): void {
if (!FreshRSS_Context::hasSystemConf()) {
throw new FreshRSS_Context_Exception('System configuration not initialised!');
}
$this->registerHook(
'entry_before_display',
array('ImageProxyExtension', 'setImageProxyHook')
);
$this->registerHook('entry_before_display', [self::class, 'setImageProxyHook']);
// Defaults
$save = false;
if (is_null(FreshRSS_Context::userConf()->image_proxy_url)) {
Expand Down
5 changes: 1 addition & 4 deletions xExtension-TTRSS_API/extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ final class TTRSS_APIExtension extends Minz_Extension {

#[Override]
public function init(): void {
$this->registerHook(
'post_update',
array($this, 'postUpdateHook')
);
$this->registerHook('post_update', [self::class, 'postUpdateHook']);
}

#[Override]
Expand Down
4 changes: 2 additions & 2 deletions xExtension-YouTube/extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ final class YouTubeExtension extends Minz_Extension
#[Override]
public function init(): void
{
$this->registerHook('entry_before_display', array($this, 'embedYouTubeVideo'));
$this->registerHook('check_url_before_add', array($this, 'convertYoutubeFeedUrl'));
$this->registerHook('entry_before_display', [self::class, 'embedYouTubeVideo']);
$this->registerHook('check_url_before_add', [self::class, 'convertYoutubeFeedUrl']);
$this->registerTranslates();
}

Expand Down

0 comments on commit 55ae636

Please sign in to comment.