<?php

namespace WPSN\Core;

defined('ABSPATH') || exit;

/**
 * Thin wrapper around WordPress actions/filters for internal event naming.
 */
final class Events
{
    /**
     * @param array<int, mixed> $args
     */
    public function dispatch(string $event, array $args = []): void
    {
        /**
         * Fires when an internal WPSN event happens.
         *
         * @since 0.1.0
         */
        do_action($event, ...$args);
    }

    /**
     * @param mixed $value
     * @param array<int, mixed> $args
     * @return mixed
     */
    public function filter(string $hook, $value, array $args = [])
    {
        return apply_filters($hook, $value, ...$args);
    }
}
