Skip to content

Commit

Permalink
API Set extension hook implementation visibility to protected
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed May 16, 2024
1 parent 23c6644 commit 11b05f7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions code/AuditHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static function handle_manipulation($manipulation)
/**
* Log a record being published.
*/
public function onAfterPublish(&$original)
protected function onAfterPublish(&$original)
{
$member = Security::getCurrentUser();
if (!$member || !$member->exists()) {
Expand Down Expand Up @@ -203,7 +203,7 @@ public function onAfterPublish(&$original)
/**
* Log a record being unpublished.
*/
public function onAfterUnpublish()
protected function onAfterUnpublish()
{
$member = Security::getCurrentUser();
if (!$member || !$member->exists()) {
Expand All @@ -223,7 +223,7 @@ public function onAfterUnpublish()
/**
* Log a record being reverted to live.
*/
public function onAfterRevertToLive()
protected function onAfterRevertToLive()
{
$member = Security::getCurrentUser();
if (!$member || !$member->exists()) {
Expand All @@ -244,7 +244,7 @@ public function onAfterRevertToLive()
/**
* Log a record being duplicated.
*/
public function onAfterDuplicate()
protected function onAfterDuplicate()
{
$member = Security::getCurrentUser();
if (!$member || !$member->exists()) {
Expand Down Expand Up @@ -284,7 +284,7 @@ public function onAfterDelete()
/**
* Log a record being restored to stage.
*/
public function onAfterRestoreToStage()
protected function onAfterRestoreToStage()
{
$member = Security::getCurrentUser();
if (!$member || !$member->exists()) {
Expand Down Expand Up @@ -316,7 +316,7 @@ public function afterMemberLoggedIn()
/**
* Log successfully restored sessions from "remember me" cookies ("auto login").
*/
public function memberAutoLoggedIn()
protected function memberAutoLoggedIn()
{
$this->getAuditLogger()->info(sprintf(
'"%s" (ID: %s) successfully restored autologin session',
Expand Down Expand Up @@ -348,15 +348,15 @@ public function authenticationFailed($data)
/**
* Log failed login attempts when the email address doesn't map to an existing member record
*/
public function authenticationFailedUnknownUser($data)
protected function authenticationFailedUnknownUser($data)
{
$this->authenticationFailed($data);
}

/**
* Log permission failures (where the status is set after init of page).
*/
public function onAfterInit()
protected function onAfterInit()
{
// Suppress errors if dev/build necessary
if (!Security::database_is_ready()) {
Expand Down
10 changes: 5 additions & 5 deletions code/AuditHookMFA.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AuditHookMFA extends DataExtension
* @param Member $member
* @param MethodInterface $method
*/
public function onMethodVerificationSuccess(Member $member, $method)
protected function onMethodVerificationSuccess(Member $member, $method)
{
$this->getAuditLogger()->info(
sprintf(
Expand All @@ -41,7 +41,7 @@ public function onMethodVerificationSuccess(Member $member, $method)
* @param Member $member
* @param MethodInterface $method
*/
public function onMethodVerificationFailure(Member $member, $method)
protected function onMethodVerificationFailure(Member $member, $method)
{
$context = [
'method' => get_class($method),
Expand All @@ -64,7 +64,7 @@ public function onMethodVerificationFailure(Member $member, $method)
*
* @param Member $member
*/
public function onSkipRegistration(Member $member)
protected function onSkipRegistration(Member $member)
{
$this->getAuditLogger()->info(sprintf(
'"%s" (ID: %s) skipped MFA registration',
Expand All @@ -77,7 +77,7 @@ public function onSkipRegistration(Member $member)
* @param Member $member
* @param MethodInterface $method
*/
public function onRegisterMethod(Member $member, $method)
protected function onRegisterMethod(Member $member, $method)
{
$context = [
'method' => get_class($method),
Expand All @@ -96,7 +96,7 @@ public function onRegisterMethod(Member $member, $method)
* @param Member $member
* @param MethodInterface $method
*/
public function onRegisterMethodFailure(Member $member, $method)
protected function onRegisterMethodFailure(Member $member, $method)
{
$context = [
'method' => get_class($method),
Expand Down
2 changes: 1 addition & 1 deletion code/AuditHookSessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AuditHookSessionManager extends DataExtension
*
* @param LoginSession $loginSession
*/
public function onBeforeRemoveLoginSession(LoginSession $loginSession)
protected function onBeforeRemoveLoginSession(LoginSession $loginSession)
{
$member = $loginSession->Member();
$currentUser = Security::getCurrentUser();
Expand Down
2 changes: 1 addition & 1 deletion code/Extensions/DatabaseExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class DatabaseExtension extends Extension
{
public function onBeforeManipulate(array &$manipulation)
protected function onBeforeManipulate(array &$manipulation)
{
AuditHook::handle_manipulation($manipulation);
}
Expand Down

0 comments on commit 11b05f7

Please sign in to comment.