From 6fdf20b9c98c6646213d4cb1d9a4feaadf1ec824 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Mon, 19 Aug 2024 14:16:43 +1200 Subject: [PATCH] API Standardise extension hooks --- src/Dev/VersionedTestSessionExtension.php | 2 +- src/Versioned.php | 4 ++-- src/VersionedStateExtension.php | 2 +- tests/php/VersionedTest/PublicExtension.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Dev/VersionedTestSessionExtension.php b/src/Dev/VersionedTestSessionExtension.php index b3f45f0e..7425589a 100644 --- a/src/Dev/VersionedTestSessionExtension.php +++ b/src/Dev/VersionedTestSessionExtension.php @@ -19,7 +19,7 @@ class VersionedTestSessionExtension extends VersionedStateExtension * * @param string $url */ - public function updateLink(&$url) + protected function updateLink(&$url) { $session = $this->owner->session(); if (!$session) { diff --git a/src/Versioned.php b/src/Versioned.php index 11d04ac7..cb1753ad 100644 --- a/src/Versioned.php +++ b/src/Versioned.php @@ -1589,7 +1589,7 @@ protected function extendcanRestoreToDraft() * @param Member $member * @return bool|null */ - public function canView($member = null) + protected function canView($member = null) { // Invoke default version-gnostic canView if ($this->owner->canViewVersioned($member) === false) { @@ -2888,7 +2888,7 @@ protected function onBeforeDuplicate($source, $doWrite) $this->owner->Version = 0; } - public function flushCache() + protected function onFlushCache() { Versioned::$cache_versionnumber = []; $this->versionModifiedCache = []; diff --git a/src/VersionedStateExtension.php b/src/VersionedStateExtension.php index 4c87b9b8..98dd1a12 100644 --- a/src/VersionedStateExtension.php +++ b/src/VersionedStateExtension.php @@ -30,7 +30,7 @@ class VersionedStateExtension extends Extension * * @param string $link */ - public function updateLink(&$link) + protected function updateLink(&$link) { // Skip if link already contains reading mode if ($this->hasVersionedQuery($link)) { diff --git a/tests/php/VersionedTest/PublicExtension.php b/tests/php/VersionedTest/PublicExtension.php index 75fae2b7..2dc7c870 100644 --- a/tests/php/VersionedTest/PublicExtension.php +++ b/tests/php/VersionedTest/PublicExtension.php @@ -10,7 +10,7 @@ */ class PublicExtension extends DataExtension implements TestOnly { - public function canViewNonLive($member = null) + protected function canViewNonLive($member = null) { return true; }