@@ -26,16 +26,15 @@ public function keys(): array {
2626
2727 #[\Override]
2828 public function get (string |\BackedEnum $ policyKey ): IPolicyDefinition {
29- $ instanceBaseTemplate = $ this ->resolveInstanceBaseTemplate ();
3029 return match ($ this ->normalizePolicyKey ($ policyKey )) {
3130 self ::KEY => new PolicySpec (
3231 key: self ::KEY ,
33- defaultSystemValue: FooterPolicyValue::encode (FooterPolicyValue::defaults ($ instanceBaseTemplate )),
32+ defaultSystemValue: FooterPolicyValue::encode (FooterPolicyValue::defaults ()),
3433 allowedValues: static fn (): array => [],
35- normalizer: function (mixed $ rawValue) use ( $ instanceBaseTemplate ): mixed {
36- return FooterPolicyValue::encode (FooterPolicyValue::normalize ($ rawValue, $ instanceBaseTemplate ));
34+ normalizer: static function (mixed $ rawValue ): mixed {
35+ return FooterPolicyValue::encode (FooterPolicyValue::normalize ($ rawValue ));
3736 },
38- validator: function (mixed $ value , PolicyContext $ context) use ( $ instanceBaseTemplate ): void {
37+ validator: static function (mixed $ value , PolicyContext $ context ): void {
3938 if (!is_string ($ value ) || trim ($ value ) === '' ) {
4039 throw new \InvalidArgumentException ('Invalid value for ' . self ::KEY );
4140 }
@@ -46,7 +45,7 @@ public function get(string|\BackedEnum $policyKey): IPolicyDefinition {
4645 }
4746
4847 if (!self ::canManageTechnicalFooterSettings ($ context )) {
49- $ normalized = FooterPolicyValue::normalize ($ decoded, $ instanceBaseTemplate );
48+ $ normalized = FooterPolicyValue::normalize ($ decoded );
5049 if ($ normalized ['validationSite ' ] !== '' ) {
5150 throw new \InvalidArgumentException ('Validation URL override is not allowed for this actor ' );
5251 }
@@ -72,11 +71,4 @@ private static function canManageTechnicalFooterSettings(PolicyContext $context)
7271 return ($ capabilities ['canManageSystemPolicies ' ] ?? false ) === true
7372 || ($ capabilities ['canManageGroupPolicies ' ] ?? false ) === true ;
7473 }
75-
76- private function resolveInstanceBaseTemplate (): string {
77- $ defaultTemplatePath = __DIR__ . '/../../../../Handler/Templates/footer.twig ' ;
78- $ defaultTemplate = @file_get_contents ($ defaultTemplatePath );
79-
80- return is_string ($ defaultTemplate ) ? $ defaultTemplate : '' ;
81- }
8274}
0 commit comments