Change visibility of the rules constants in TwigValidatorRulePluginBase

Created on 4 April 2025, 2 days ago

Version

  • Drupal version: 11.1
  • Twig version: 3.19.0

Problem/Motivation

1. I have implemented `hook_twig_validator_rule_info_alter` to change some of the rules being validated
2. I would like to do the following to make the code more visible but the property visibility rules do not allow me to do this:
$info['filter']['rule_on_name'][TwigValidatorRulePluginBase::RULE_NAME_ALLOW][] = 'raw';

Proposed resolution

1. Update the RULE_NAME_ALLOW, RULE_NAME_IGNORE, RULE_NAME_FORBIDDEN to public or perhaps move to an ENUM so that they can be used in the alter hook.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia RichardGaunt Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024