Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
11 | #[Package('merchant-services')] |
||
12 | class ApprovalDetector |
||
13 | { |
||
14 | public const SYSTEM_CONFIG_KEY_SHARE_DATA = 'core.usage_data.shareUsageData'; |
||
15 | |||
16 | public function __construct( |
||
17 | private readonly bool $needsApprovalRequest, |
||
18 | private readonly SystemConfigService $systemConfigService, |
||
19 | ) { |
||
20 | } |
||
21 | |||
22 | public function needsApprovalRequest(): bool |
||
23 | { |
||
24 | return $this->needsApprovalRequest; |
||
25 | } |
||
26 | |||
27 | public function isApprovalAlreadyRequested(): bool |
||
28 | { |
||
29 | return $this->systemConfigService->get(ApprovalDetector::SYSTEM_CONFIG_KEY_SHARE_DATA) !== null; |
||
30 | } |
||
31 | |||
32 | public function isApprovalGiven(): bool |
||
35 | } |
||
36 | } |
||
37 |