actions = $actions; } /** * Validates the inputs of each registered action. * * @return void if the input is valid * @throws ValidationException if the input is invalid */ public function validate_inputs(): void { foreach ($this->actions as $action) $action->validate_inputs(); } /** * Updates all trackings and processes the mail queue at a regular interval. * * @return never */ public function handle(): never { // @phpstan-ignore-next-line while (true) { print("Emulating cron jobs.\n"); foreach ($this->actions as $action) $action->handle(); print("Done\n"); sleep(self::INTERVAL); } } }