1 | <?php declare(strict_types=1); |
||
33 | class PolicyEnforcementPoint implements PolicyEnforcementPointInterface, LoggerAwareInterface |
||
34 | { |
||
35 | use LoggerAwareTrait; |
||
36 | |||
37 | /** |
||
38 | * @var PolicyInformationPointInterface |
||
39 | */ |
||
40 | private $pip; |
||
41 | |||
42 | /** |
||
43 | * @var PolicyDecisionPointInterface |
||
44 | */ |
||
45 | private $pdp; |
||
46 | |||
47 | /** |
||
48 | * @var bool |
||
49 | */ |
||
50 | private $isExecuteAdvice = true; |
||
51 | |||
52 | /** |
||
53 | 8 | * @param PolicyInformationPointInterface $pip |
|
54 | * @param PolicyDecisionPointInterface $pdp |
||
55 | 8 | */ |
|
56 | 8 | public function __construct(PolicyInformationPointInterface $pip, PolicyDecisionPointInterface $pdp) |
|
61 | |||
62 | 8 | /** |
|
63 | * @inheritdoc |
||
64 | 8 | */ |
|
65 | public function authorize(RequestInterface $request): bool |
||
88 | |||
89 | 8 | /** |
|
90 | * @return bool |
||
91 | 8 | */ |
|
92 | public function isExecuteAdvice(): bool |
||
96 | |||
97 | 8 | /** |
|
98 | * @return self |
||
99 | 8 | */ |
|
100 | public function enableExecuteAdvice(): self |
||
106 | |||
107 | 8 | /** |
|
108 | * @return self |
||
109 | 8 | */ |
|
110 | public function disableExecuteAdvice(): self |
||
116 | |||
117 | 8 | /** |
|
118 | * @return PolicyInformationPointInterface |
||
119 | 8 | */ |
|
120 | protected function getPip(): PolicyInformationPointInterface |
||
124 | |||
125 | 8 | /** |
|
126 | * @return PolicyDecisionPointInterface |
||
127 | 8 | */ |
|
128 | protected function getPdp(): PolicyDecisionPointInterface |
||
132 | |||
133 | /** |
||
134 | * @param int $evaluation |
||
135 | 8 | * |
|
136 | * @return bool |
||
137 | 8 | */ |
|
138 | protected function interpretEvaluation(int $evaluation): bool |
||
142 | } |
||
143 |