PointcutSettingFilter
class PointcutSettingFilter implements PointcutFilterInterface (View source)
A settings filter which fires on configuration setting set to true or equal to the given condition.
Example: setting(FooPackage.configuration.option = 'AOP is cool')
Constants
PATTERN_SPLITBYEQUALSIGN |
|
PATTERN_MATCHVALUEINQUOTES |
|
Properties
protected ConfigurationManager | $configurationManager | ||
protected string | $settingComparisonExpression | The path leading to the setting to match with |
|
protected mixed | $actualSettingValue | The value of the specified setting |
|
protected mixed | $condition | The condition value to match against the configuration setting |
|
protected bool | $cachedResult |
Methods
The constructor - initializes the configuration filter with the path to a configuration option
Injects the configuration manager
Checks if the specified configuration option is set to true or false, or if it matches the specified condition
Returns true if this filter holds runtime evaluations for a previously matched pointcut
Returns runtime evaluations for the pointcut.
Parses the given configuration path expression and sets $this->actualSettingValue and $this->condition accordingly
This method is used to optimize the matching process.
Details
__construct(string $settingComparisonExpression)
The constructor - initializes the configuration filter with the path to a configuration option
void
injectConfigurationManager(ConfigurationManager $configurationManager)
Injects the configuration manager
bool
matches(string $className, string $methodName, string $methodDeclaringClassName, mixed $pointcutQueryIdentifier)
Checks if the specified configuration option is set to true or false, or if it matches the specified condition
bool
hasRuntimeEvaluationsDefinition()
Returns true if this filter holds runtime evaluations for a previously matched pointcut
array
getRuntimeEvaluationsDefinition()
Returns runtime evaluations for the pointcut.
protected void
parseConfigurationOptionPath(string $settingComparisonExpression)
Parses the given configuration path expression and sets $this->actualSettingValue and $this->condition accordingly
ClassNameIndex
reduceTargetClassNames(ClassNameIndex $classNameIndex)
This method is used to optimize the matching process.