Better syntax for registerHook

This commit is contained in:
Alexandre Alapetite 2024-04-07 19:43:54 +02:00
parent cc6bf0d1e6
commit 55ae6368ee
No known key found for this signature in database
GPG key ID: A24378C38E812B23
3 changed files with 4 additions and 10 deletions

View file

@ -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();
}