mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
MDL-81525 core_user: Use stoppable trait for consistency
This commit is contained in:
parent
6db4285eaa
commit
b32fb636c5
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user