Skip to content

Commit

Permalink
MDL-81525 core_user: Use stoppable trait for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Apr 15, 2024
1 parent 6db4285 commit b32fb63
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions user/classes/hook/before_user_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@
#[\core\attribute\label('Allows plugins or features to perform actions before a user is deleted.')]
#[\core\attribute\tags('user')]
class before_user_deleted implements
StoppableEventInterface {

/**
* @var bool Whether the propagation of this event has been stopped.
*/
protected bool $stopped = false;
StoppableEventInterface
{
use \core\hook\stoppable_trait;

/**
* Constructor for the hook.
Expand All @@ -45,15 +42,4 @@ public function __construct(
public readonly stdClass $user,
) {
}

public function isPropagationStopped(): bool {
return $this->stopped;
}

/**
* Stop the propagation of this event.
*/
public function stop(): void {
$this->stopped = true;
}
}

0 comments on commit b32fb63

Please sign in to comment.