Completed
Push — master ( f4f9e6...43b9e4 )
by Андрей
03:53 queued 01:46
created

Module   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 65
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 65
loc 65
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCommonModuleOptions() 6 6 1
A getModuleConfigKey() 4 4 1
A getAutoloaderConfig() 10 10 1
A getConfig() 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
 * @link    https://github.com/nnx-framework/container
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\Container\PhpUnit\TestData\ContextResolver\Custom\Service\Service;
7
8
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
9
use Zend\ModuleManager\Feature\ConfigProviderInterface;
10
use Nnx\ModuleOptions\ModuleConfigKeyProviderInterface;
11
use Nnx\Container\PhpUnit\TestData\ContextResolver\Custom\Service as CustomService;
12
13
14
/**
15
 * Class Module
16
 *
17
 * @package Nnx\Container\PhpUnit\TestData\ContextResolver\Custom\Service\Service
18
 */
19 View Code Duplication
class Module implements
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...
20
    AutoloaderProviderInterface,
21
    ConfigProviderInterface,
22
    ModuleConfigKeyProviderInterface
23
{
24
25
    /**
26
     * Имя секции в конфиги приложения отвечающей за настройки модуля
27
     *
28
     * @var string
29
     */
30
    const CONFIG_KEY = 'custom_service_service';
31
32
    /**
33
     * Имя модуля
34
     *
35
     * @var string
36
     */
37
    const MODULE_NAME = __NAMESPACE__;
38
39
    /**
40
     * @inheritdoc
41
     *
42
     * @return array
43
     */
44
    public function getCommonModuleOptions()
45
    {
46
        return [
47
            'test_token'
48
        ];
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getModuleConfigKey()
55
    {
56
        return static::CONFIG_KEY;
57
    }
58
59
    /**
60
     * @return array
61
     */
62
    public function getAutoloaderConfig()
63
    {
64
        return [
65
            'Zend\Loader\StandardAutoloader' => [
66
                'namespaces' => [
67
                    __NAMESPACE__ => __DIR__ . '/src/',
68
                ],
69
            ],
70
        ];
71
    }
72
73
74
    /**
75
     * @inheritdoc
76
     *
77
     * @return array
78
     */
79
    public function getConfig()
80
    {
81
        return include __DIR__ . '/config/module.config.php';
82
    }
83
}