Total Complexity | 3 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
23 | class ApiController extends Controller |
||
24 | { |
||
25 | // Constants |
||
26 | // ========================================================================= |
||
27 | |||
28 | // Protected Properties |
||
29 | // ========================================================================= |
||
30 | |||
31 | /** |
||
32 | * @inheritdoc |
||
33 | */ |
||
34 | protected array|bool|int $allowAnonymous = [ |
||
35 | 'get-redirects', |
||
36 | ]; |
||
37 | |||
38 | // Public Methods |
||
39 | // ========================================================================= |
||
40 | |||
41 | /** |
||
42 | * @inheritDoc |
||
43 | */ |
||
44 | public function beforeAction($action): bool |
||
45 | { |
||
46 | if (!Retour::$settings->enableApiEndpoint) { |
||
47 | $this->allowAnonymous = false; |
||
48 | } |
||
49 | |||
50 | return parent::beforeAction($action); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @param null $siteId |
||
55 | * @return Response |
||
56 | */ |
||
57 | public function actionGetRedirects($siteId = null): Response |
||
62 | } |
||
63 | } |
||
64 |