<?php

namespace Licenzo\Helper;

if (!defined('ABSPATH')) {
    exit;
}

class Filter extends Hook
{
    public static function add($tag, $functionToAdd, $priority = 10, $acceptedArgs = 1)
    {
        // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.InvalidPrefixPassed, WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
        return add_filter(static::getTagWithPrefix($tag), $functionToAdd, $priority, $acceptedArgs);
    }

    public static function apply($tag, $value, ...$args)
    {
        // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.InvalidPrefixPassed, WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
        return apply_filters(static::getTagWithPrefix($tag), $value, ...$args);
    }

    public static function remove($tag, $functionToRemove, $priority = 10)
    {
        // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.InvalidPrefixPassed, WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
        return remove_filter(static::getTagWithPrefix($tag), $functionToRemove, $priority);
    }

    public static function has($tag)
    {
        // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.InvalidPrefixPassed, WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
        return has_filter(static::getTagWithPrefix($tag));
    }
}
