Skip to content

Commit 808247b

Browse files
committed
refactor(policy): require PolicyService for collect metadata runtime
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 845407e commit 808247b

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

lib/Service/SignFileService.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function __construct(
124124
private PfxProvider $pfxProvider,
125125
private SubjectAlternativeNameService $subjectAlternativeNameService,
126126
private SignRequestService $signRequestService,
127-
private ?PolicyService $policyService = null,
127+
private PolicyService $policyService,
128128
) {
129129
}
130130

@@ -1032,15 +1032,7 @@ public function storeUserMetadata(array $metadata = []): self {
10321032
}
10331033

10341034
private function isCollectMetadataEnabled(): bool {
1035-
if ($this->policyService !== null) {
1036-
try {
1037-
return (bool)$this->policyService->resolve(CollectMetadataPolicy::KEY)->getEffectiveValue();
1038-
} catch (\Throwable) {
1039-
// Fallback keeps legacy behavior during migration rollout.
1040-
}
1041-
}
1042-
1043-
return $this->appConfig->getValueBool(Application::APP_ID, CollectMetadataPolicy::SYSTEM_APP_CONFIG_KEY, false);
1035+
return (bool)$this->policyService->resolve(CollectMetadataPolicy::KEY)->getEffectiveValue();
10441036
}
10451037

10461038
/**

0 commit comments

Comments
 (0)