|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* WebHemi. |
|
4
|
|
|
* |
|
5
|
|
|
* PHP version 7.1 |
|
6
|
|
|
* |
|
7
|
|
|
* @copyright 2012 - 2017 Gixx-web (http://www.gixx-web.com) |
|
8
|
|
|
* @license https://opensource.org/licenses/MIT The MIT License (MIT) |
|
9
|
|
|
* |
|
10
|
|
|
* @link http://www.gixx-web.com |
|
11
|
|
|
*/ |
|
12
|
|
|
declare(strict_types = 1); |
|
13
|
|
|
|
|
14
|
|
|
namespace WebHemi\Middleware\Action\Admin\Applications; |
|
15
|
|
|
|
|
16
|
|
|
use WebHemi\Application\EnvironmentManager; |
|
17
|
|
|
use WebHemi\Adapter\Auth\AuthAdapterInterface; |
|
18
|
|
|
use WebHemi\Config\ConfigInterface; |
|
19
|
|
|
use WebHemi\Middleware\AbstractMiddlewareAction; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* Class AddAction |
|
23
|
|
|
*/ |
|
24
|
|
View Code Duplication |
class AddAction extends AbstractMiddlewareAction |
|
|
|
|
|
|
25
|
|
|
{ |
|
26
|
|
|
/** @var ConfigInterface */ |
|
27
|
|
|
private $configuration; |
|
28
|
|
|
/** @var AuthAdapterInterface */ |
|
29
|
|
|
private $authAdapter; |
|
30
|
|
|
/** @var EnvironmentManager */ |
|
31
|
|
|
private $environmentManager; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* DashboardAction constructor. |
|
35
|
|
|
* |
|
36
|
|
|
* @param ConfigInterface $configuration |
|
37
|
|
|
* @param AuthAdapterInterface $authAdapter |
|
38
|
|
|
* @param EnvironmentManager $environmentManager |
|
39
|
|
|
*/ |
|
40
|
|
|
public function __construct( |
|
41
|
|
|
ConfigInterface $configuration, |
|
42
|
|
|
AuthAdapterInterface $authAdapter, |
|
43
|
|
|
EnvironmentManager $environmentManager |
|
44
|
|
|
) { |
|
45
|
|
|
$this->configuration = $configuration; |
|
46
|
|
|
$this->authAdapter = $authAdapter; |
|
47
|
|
|
$this->environmentManager = $environmentManager; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Gets template map name or template file path. |
|
52
|
|
|
* |
|
53
|
|
|
* @return string |
|
54
|
|
|
*/ |
|
55
|
|
|
public function getTemplateName() : string |
|
56
|
|
|
{ |
|
57
|
|
|
return 'admin-applications-add'; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Gets template data. |
|
62
|
|
|
* |
|
63
|
|
|
* @return array |
|
64
|
|
|
*/ |
|
65
|
|
|
public function getTemplateData() : array |
|
66
|
|
|
{ |
|
67
|
|
|
return []; |
|
68
|
|
|
} |
|
69
|
|
|
} |
|
70
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.