1 | <?php |
||
24 | final class PolicyDecision implements PolicyDecisionInterface |
||
25 | { |
||
26 | const DECISION_DENY = 'Deny'; |
||
27 | const DECISION_INDETERMINATE = 'Indeterminate'; |
||
28 | const DECISION_NOT_APPLICABLE = 'NotApplicable'; |
||
29 | const DECISION_PERMIT = 'Permit'; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $decision; |
||
35 | |||
36 | /** |
||
37 | * @var string|null |
||
38 | */ |
||
39 | private $statusMessage; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | private $statusCode; |
||
45 | |||
46 | /** |
||
47 | * @var string[] |
||
48 | */ |
||
49 | public $loaObligations = []; |
||
50 | |||
51 | /** |
||
52 | * @param Response $response |
||
53 | * @return PolicyDecision |
||
54 | */ |
||
55 | public static function fromResponse(Response $response) |
||
78 | |||
79 | /** |
||
80 | * @return bool |
||
81 | */ |
||
82 | public function permitsAccess() |
||
86 | |||
87 | /** |
||
88 | * @return string |
||
|
|||
89 | */ |
||
90 | public function getStatusMessage() |
||
98 | |||
99 | /** |
||
100 | * Get the status message or status code of the decision. |
||
101 | * |
||
102 | * If no status message was present in the response this method will |
||
103 | * return the status code instead. |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getFormattedStatus() |
||
115 | |||
116 | /** |
||
117 | * @return bool |
||
118 | */ |
||
119 | public function hasStatusMessage() |
||
123 | |||
124 | /** |
||
125 | * @return bool |
||
126 | */ |
||
127 | public function hasLoaObligations() |
||
131 | |||
132 | /** |
||
133 | * @return string[] |
||
134 | */ |
||
135 | public function getLoaObligations() |
||
139 | } |
||
140 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.