<?php

namespace GriffinForms\Admin\Actions;

use \GriffinForms\Traits\Singleton;

class ProcessActions extends \GriffinForms\Admin\Format
{
    use Singleton;

    /**
     * Array of action handler classes to be registered.
     *
     * @var array<class-string>
     */
    protected $action_classes = [
        Submissions::class,
        Submission::class,
        // Add more action classes here as needed
    ];

    /**
     * Register all action handler classes.
     */
    public function register()
    {
        foreach ($this->action_classes as $action_class) {
            if (method_exists($action_class, 'getInstance')) {
                $action_instance = $action_class::getInstance();
            } else {
                $action_instance = new $action_class();
            }
            if (method_exists($action_instance, 'register')) {
                $action_instance->register();
            }
        }
    }
}