Completed
Push — master ( 8d8910...2c63a2 )
by Dante
14s
created

PlaygroundController::initialize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 6
rs 10
1
<?php
2
/**
3
 * BEdita, API-first content management framework
4
 * Copyright 2026 ChannelWeb Srl, Chialab Srl
5
 *
6
 * This file is part of BEdita: you can redistribute it and/or modify
7
 * it under the terms of the GNU Lesser General Public License as published
8
 * by the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * See LICENSE.LGPL or <http://gnu.org/licenses/lgpl-3.0.html> for more details.
12
 */
13
namespace App\Controller;
14
15
use Cake\Core\Configure;
16
17
/**
18
 * Playground controller for testing Vue components in development.
19
 * Only accessible in DEVELOPMENT mode.
20
 *
21
 * {@codeCoverageIgnore}
22
 */
23
class PlaygroundController extends AppController
24
{
25
    /**
26
     * @inheritDoc
27
     */
28
    public function initialize(): void
29
    {
30
        if (Configure::read('development') !== true) {
31
            $this->redirect(['controller' => 'Dashboard', 'action' => 'index']);
32
        }
33
        parent::initialize();
34
    }
35
36
    /**
37
     * @inheritDoc
38
     */
39
    public function index(): void
40
    {
41
        $this->getRequest()->allowMethod(['get']);
42
    }
43
}
44