|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
namespace eXpansion\Framework\Core\Model\Gui; |
|
5
|
|
|
use eXpansion\Framework\Core\Helpers\Translations; |
|
6
|
|
|
use eXpansion\Framework\Core\Plugins\Gui\ActionFactory; |
|
7
|
|
|
use eXpansion\Framework\Core\Plugins\GuiHandler; |
|
8
|
|
|
use eXpansion\Framework\Core\Plugins\UserGroups\Factory; |
|
9
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Class WindowFactoryContext |
|
13
|
|
|
* |
|
14
|
|
|
* @package eXpansion\Framework\Core\Model\Gui; |
|
15
|
|
|
* @author oliver de Cramer <[email protected]> |
|
16
|
|
|
*/ |
|
17
|
|
View Code Duplication |
class WindowFactoryContext extends WidgetFactoryContext |
|
|
|
|
|
|
18
|
|
|
{ |
|
19
|
|
|
|
|
20
|
|
|
/** @var ManiaScriptFactory */ |
|
21
|
|
|
protected $windowManiaScriptFactory; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* WindowFactoryContext constructor. |
|
25
|
|
|
* |
|
26
|
|
|
* @param $className |
|
27
|
|
|
* @param GuiHandler $guiHandler |
|
28
|
|
|
* @param Factory $groupFactory |
|
29
|
|
|
* @param ActionFactory $actionFactory |
|
30
|
|
|
* @param Translations $translations |
|
31
|
|
|
* @param ManiaScriptFactory $maniaScriptFactory |
|
32
|
|
|
*/ |
|
33
|
|
|
public function __construct( |
|
34
|
|
|
$className, |
|
35
|
|
|
GuiHandler $guiHandler, |
|
36
|
|
|
Factory $groupFactory, |
|
37
|
|
|
ActionFactory $actionFactory, |
|
38
|
|
|
Translations $translations, |
|
39
|
|
|
ManiaScriptFactory $maniaScriptFactory |
|
40
|
|
|
) { |
|
41
|
|
|
parent::__construct($className, $guiHandler, $groupFactory, $actionFactory, $translations); |
|
42
|
|
|
|
|
43
|
|
|
$this->windowManiaScriptFactory = $maniaScriptFactory; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @return ManiaScriptFactory |
|
48
|
|
|
*/ |
|
49
|
|
|
public function getWindowManiaScriptFactory() |
|
50
|
|
|
{ |
|
51
|
|
|
return $this->windowManiaScriptFactory; |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|
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.