Total Complexity | 2 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
26 | class ForbiddenException extends Exception |
||
27 | { |
||
28 | /** |
||
29 | * {@inheritDoc} |
||
30 | */ |
||
31 | protected $code = 403; |
||
32 | |||
33 | /** |
||
34 | * {@inheritDoc} |
||
35 | */ |
||
36 | protected $messageTemplate = 'Identity is not authorized to perform `%s` on `%s`.'; |
||
37 | |||
38 | /** |
||
39 | * Policy check result. |
||
40 | * |
||
41 | * @var \Phauthentic\Authorization\Policy\ResultInterface|null |
||
42 | */ |
||
43 | protected $result; |
||
44 | |||
45 | /** |
||
46 | * Returns policy check result if passed to the exception. |
||
47 | * |
||
48 | * @param \Phauthentic\Authorization\Policy\ResultInterface|null $result Result |
||
49 | * @return $this |
||
50 | */ |
||
51 | public function setResult(?ResultInterface $result) |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Returns policy check result if passed to the exception. |
||
59 | * |
||
60 | * @return \Phauthentic\Authorization\Policy\ResultInterface|null |
||
61 | */ |
||
62 | public function getResult(): ?ResultInterface |
||
67 |