configurationManager = $configurationManager; } /** * @param MethodTargetExpressionParser $methodTargetExpressionParser */ public function injectMethodTargetExpressionParser(MethodTargetExpressionParser $methodTargetExpressionParser): void { $this->methodTargetExpressionParser = $methodTargetExpressionParser; } /** * @inheritDoc * @throws InvalidConfigurationTypeException * @throws InvalidPointcutExpressionException * @throws NeosFlowAopException */ public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier): bool { $this->buildPointcutFilters(); foreach ($this->pointcutFilterComposites as $pointcutFilterComposite) { if ( $pointcutFilterComposite->matches( $className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier ) ) { return true; } } return false; } /** * @inheritDoc */ public function hasRuntimeEvaluationsDefinition(): bool { return false; } /** * @inheritDoc */ public function getRuntimeEvaluationsDefinition(): array { return []; } /** * @inheritDoc * @throws InvalidConfigurationTypeException * @throws InvalidPointcutExpressionException * @throws NeosFlowAopException */ public function reduceTargetClassNames(ClassNameIndex $classNameIndex): ClassNameIndex { $this->buildPointcutFilters(); $result = new ClassNameIndex(); foreach ($this->pointcutFilterComposites as $pointcutFilterComposite) { $result->applyUnion($pointcutFilterComposite->reduceTargetClassNames($classNameIndex)); } return $result; } /** * @throws InvalidConfigurationTypeException * @throws InvalidPointcutExpressionException * @throws NeosFlowAopException */ protected function buildPointcutFilters(): void { if ($this->pointcutFilterComposites !== null) { return; } $this->pointcutFilterComposites = []; foreach ( $this->configurationManager->getConfiguration( ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'DigiComp.FlowSessionLock.readOnlyExpressions' ) as $key => $pointcutExpression ) { if ($pointcutExpression === null) { continue; } $this->pointcutFilterComposites[] = $this->methodTargetExpressionParser->parse( $pointcutExpression, 'Settings.yaml at "DigiComp.FlowSessionLock.readOnlyExpressions", key: "' . $key . '"' ); } } }