Completed
Pull Request — master (#99)
by De Cramer
02:57
created

WidgetFactoryContext   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 34
loc 34
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 11 11 1
A getTranslationsHelper() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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 WidgetFactoryContext
13
 *
14
 * @package eXpansion\Framework\Core\Model\Gui;
15
 * @author  oliver de Cramer <[email protected]>
16
 */
17 View Code Duplication
class WidgetFactoryContext extends ManialinkFactoryContext
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
18
{
19
    /** @var Translations */
20
    protected $translationsHelper;
21
22
    /**
23
     * WidgetFactoryContext constructor.
24
     *
25
     * @param               $className
26
     * @param GuiHandler    $guiHandler
27
     * @param Factory       $groupFactory
28
     * @param ActionFactory $actionFactory
29
     * @param Translations  $translations
30
     */
31
    public function __construct(
32
        $className,
33
        GuiHandler $guiHandler,
34
        Factory $groupFactory,
35
        ActionFactory $actionFactory,
36
        Translations $translations)
37
    {
38
        parent::__construct($className, $guiHandler, $groupFactory, $actionFactory);
39
40
        $this->translationsHelper = $translations;
41
    }
42
43
    /**
44
     * @return Translations
45
     */
46
    public function getTranslationsHelper()
47
    {
48
        return $this->translationsHelper;
49
    }
50
}