From 819db13da505ef518188da9c9baca3291b109aeb Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 15 Aug 2024 17:10:58 +1200 Subject: [PATCH] API Standardise extension hooks --- src/Extension/FluentIsolatedExtension.php | 2 +- src/Extension/FluentLeftAndMainExtension.php | 2 +- src/Extension/FluentSiteTreeExtension.php | 6 +++--- src/Extension/FluentVersionedExtension.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Extension/FluentIsolatedExtension.php b/src/Extension/FluentIsolatedExtension.php index d3d68439..a1574c90 100644 --- a/src/Extension/FluentIsolatedExtension.php +++ b/src/Extension/FluentIsolatedExtension.php @@ -69,7 +69,7 @@ protected function augmentDatabase() } } - public function requireDefaultRecords() + protected function onRequireDefaultRecords() { // Migrate records that used to be FluentFilteredExtension $this->migrateFromFilteredExtension(); diff --git a/src/Extension/FluentLeftAndMainExtension.php b/src/Extension/FluentLeftAndMainExtension.php index f274df67..26fbe681 100644 --- a/src/Extension/FluentLeftAndMainExtension.php +++ b/src/Extension/FluentLeftAndMainExtension.php @@ -21,7 +21,7 @@ class FluentLeftAndMainExtension extends Extension use FluentAdminTrait; use FluentBadgeTrait; - public function init() + protected function onInit() { Requirements::javascript("tractorcow/silverstripe-fluent:client/dist/js/fluent.js"); Requirements::css("tractorcow/silverstripe-fluent:client/dist/styles/fluent.css"); diff --git a/src/Extension/FluentSiteTreeExtension.php b/src/Extension/FluentSiteTreeExtension.php index 47df6b95..97749022 100644 --- a/src/Extension/FluentSiteTreeExtension.php +++ b/src/Extension/FluentSiteTreeExtension.php @@ -44,7 +44,7 @@ class FluentSiteTreeExtension extends FluentVersionedExtension * * @param string &$tags */ - public function MetaTags(&$tags) + protected function updateMetaTags(&$tags) { $tags .= $this->owner->renderWith('FluentSiteTree_MetaTags'); } @@ -80,7 +80,7 @@ public function getLinkToXDefault() * @param string &$base * @param string &$action */ - public function updateRelativeLink(&$base, &$action) + protected function updateRelativeLink(&$base, &$action) { if ($this->owner->hasMethod('disablePrependLocaleURLSegmentToLink') && $this->owner->disablePrependLocaleURLSegmentToLink()) { @@ -132,7 +132,7 @@ public function updateRelativeLink(&$base, &$action) * @param string $action * @param string $relativeLink */ - public function updateLink(&$link, &$action, &$relativeLink) + protected function updateLink(&$link, &$action, &$relativeLink) { // Get appropriate locale for this record $localeObj = $this->getRecordLocale(); diff --git a/src/Extension/FluentVersionedExtension.php b/src/Extension/FluentVersionedExtension.php index 64c7c366..00903fa1 100644 --- a/src/Extension/FluentVersionedExtension.php +++ b/src/Extension/FluentVersionedExtension.php @@ -502,7 +502,7 @@ protected function isLocalisedInStage($stage, $locale = null) /** * Clear internal static property caches */ - public function flushCache() + protected function onFlushCache() { static::reset(); }