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