MDL-81525 core_user: Use stoppable trait for consistency

This commit is contained in:
Andrew Nicols 2024-04-14 21:29:48 +08:00
parent 6db4285eaa
commit b32fb636c5
No known key found for this signature in database
GPG Key ID: 6D1E3157C8CFBF14

View File

@ -29,12 +29,9 @@ use Psr\EventDispatcher\StoppableEventInterface;
#[\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.
@ -45,15 +42,4 @@ class before_user_deleted implements
public readonly stdClass $user,
) {
}
public function isPropagationStopped(): bool {
return $this->stopped;
}
/**
* Stop the propagation of this event.
*/
public function stop(): void {
$this->stopped = true;
}
}