MDL-81525 coer_enrol: Use stoppable trait for consistency

This commit is contained in:
Andrew Nicols
2024-04-15 13:05:10 +08:00
parent d602b7d3e3
commit 27a6eb0126
@@ -29,11 +29,9 @@ use Psr\EventDispatcher\StoppableEventInterface;
#[\core\attribute\label('Allows plugins or features to perform actions before the enrolment instance is deleted.')]
#[\core\attribute\tags('enrol', 'user')]
class before_enrol_instance_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 +43,4 @@ class before_enrol_instance_deleted implements
public readonly stdClass $enrolinstance,
) {
}
public function isPropagationStopped(): bool {
return $this->stopped;
}
/**
* Stop the propagation of this event.
*/
public function stop(): void {
$this->stopped = true;
}
}