1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-23 08:11:19 +01:00

Validate all attributes

This commit is contained in:
Daniil Gentili 2023-07-23 13:26:00 +02:00
parent 6dc03776ee
commit d2c68b6372
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -176,6 +176,9 @@ abstract class EventHandler extends AbstractAPI
if (!$this instanceof SimpleEventHandler) { if (!$this instanceof SimpleEventHandler) {
continue; continue;
} }
array_map(fn (ReflectionAttribute $attribute) => $attribute->newInstance(), $methodRefl->getAttributes());
if ($periodic = $methodRefl->getAttributes(Cron::class)) { if ($periodic = $methodRefl->getAttributes(Cron::class)) {
$periodic = $periodic[0]->newInstance(); $periodic = $periodic[0]->newInstance();
$this->periodicLoops[$method] = new PeriodicLoop( $this->periodicLoops[$method] = new PeriodicLoop(