Passed
Push — devel-3.0 ( 218a48...a00b1f )
by Rubén
03:54
created

WebControllerTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 23
dl 0
loc 65
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 13 1
1
<?php
2
/**
3
 * sysPass
4
 *
5
 * @author    nuxsmin
6
 * @link      https://syspass.org
7
 * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org
8
 *
9
 * This file is part of sysPass.
10
 *
11
 * sysPass is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU General Public License as published by
13
 * the Free Software Foundation, either version 3 of the License, or
14
 * (at your option) any later version.
15
 *
16
 * sysPass is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 *  along with sysPass.  If not, see <http://www.gnu.org/licenses/>.
23
 */
24
25
namespace SP\Modules\Web\Controllers\Traits;
26
27
use Klein\Klein;
28
use Psr\Container\ContainerInterface;
29
use SP\Config\Config;
30
use SP\Config\ConfigData;
31
use SP\Core\Acl\Acl;
32
use SP\Core\Context\ContextInterface;
33
use SP\Core\Context\SessionContext;
34
use SP\Core\Events\EventDispatcher;
35
use SP\Core\PhpExtensionChecker;
36
use SP\Core\UI\Theme;
37
use SP\Http\Request;
38
use SP\Mvc\Controller\ControllerTrait;
39
40
/**
41
 * Trait ControllerTratit
42
 *
43
 * @package SP\Modules\Web\Controllers
44
 */
45
trait WebControllerTrait
46
{
47
    use ControllerTrait;
48
49
    /**
50
     * @var string Nombre del controlador
51
     */
52
    protected $controllerName;
53
    /**
54
     * @var  EventDispatcher
55
     */
56
    protected $eventDispatcher;
57
    /**
58
     * @var  Config
59
     */
60
    protected $config;
61
    /**
62
     * @var  SessionContext
63
     */
64
    protected $session;
65
    /**
66
     * @var  Theme
67
     */
68
    protected $theme;
69
    /**
70
     * @var string
71
     */
72
    protected $actionName;
73
    /**
74
     * @var Klein
75
     */
76
    protected $router;
77
    /**
78
     * @var Acl
79
     */
80
    protected $acl;
81
    /**
82
     * @var ConfigData
83
     */
84
    protected $configData;
85
    /**
86
     * @var Request
87
     */
88
    protected $request;
89
    /**
90
     * @var PhpExtensionChecker
91
     */
92
    protected $extensionChecker;
93
94
    /**
95
     * @param ContainerInterface $dic
96
     */
97
    private function setUp(ContainerInterface $dic)
98
    {
99
        $this->controllerName = $this->getControllerName();
100
101
        $this->config = $dic->get(Config::class);
102
        $this->configData = $this->config->getConfigData();
103
        $this->session = $dic->get(ContextInterface::class);
104
        $this->theme = $dic->get(Theme::class);
105
        $this->eventDispatcher = $dic->get(EventDispatcher::class);
106
        $this->router = $dic->get(Klein::class);
107
        $this->request = $dic->get(Request::class);
108
        $this->acl = $dic->get(Acl::class);
109
        $this->extensionChecker = $dic->get(PhpExtensionChecker::class);
110
    }
111
}