Completed
Push — 4.0 ( 4d6b64...872671 )
by Marco
03:00
created

ServiceEvent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 64.86 %

Coupling/Cohesion

Components 0
Dependencies 9

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 9
dl 24
loc 37
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 24 24 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 namespace Comodojo\Dispatcher\Events;
2
3
use \Comodojo\Dispatcher\Traits\ConfigurationTrait;
4
use \Comodojo\Dispatcher\Traits\LoggerTrait;
5
use \Comodojo\Dispatcher\Traits\CacheTrait;
6
use \Comodojo\Dispatcher\Traits\EventsTrait;
7
use \Comodojo\Dispatcher\Traits\RequestTrait;
8
use \Comodojo\Dispatcher\Traits\ResponseTrait;
9
use \Comodojo\Dispatcher\Traits\RouterTrait;
10
use \Comodojo\Dispatcher\Traits\ExtraTrait;
11
use \Comodojo\Dispatcher\Request\Model as Request;
12
use \Comodojo\Dispatcher\Router\Model as Router;
13
use \Comodojo\Dispatcher\Response\Model as Response;
14
use \Comodojo\Dispatcher\Extra\Model as Extra;
15
use \Comodojo\Foundation\Events\AbstractEvent;
16
use \Comodojo\SimpleCache\Manager as CacheManager;
17
use \Comodojo\Foundation\Events\Manager as EventsManager;
18
use \Comodojo\Foundation\Base\Configuration;
19
use \Psr\Log\LoggerInterface;
20
21
/**
22
 * @package     Comodojo Dispatcher
23
 * @author      Marco Giovinazzi <[email protected]>
24
 * @author      Marco Castiello <[email protected]>
25
 * @license     GPL-3.0+
26
 *
27
 * LICENSE:
28
 *
29
 * This program is free software: you can redistribute it and/or modify
30
 * it under the terms of the GNU Affero General Public License as
31
 * published by the Free Software Foundation, either version 3 of the
32
 * License, or (at your option) any later version.
33
 *
34
 * This program is distributed in the hope that it will be useful,
35
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
37
 * GNU Affero General Public License for more details.
38
 *
39
 * You should have received a copy of the GNU Affero General Public License
40
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
41
 */
42
43
class ServiceEvent extends AbstractEvent {
44
45
    use ConfigurationTrait;
46
    use LoggerTrait;
47
    use CacheTrait;
48
    use EventsTrait;
49
    use RequestTrait;
50
    use RouterTrait;
51
    use ResponseTrait;
52
    use ExtraTrait;
53
54 1 View Code Duplication
    public function __construct(
0 ignored issues
show
Duplication introduced by
This method 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...
55
        $name,
56
        Configuration $configuration,
57
        LoggerInterface $logger,
58
        CacheManager $cache,
59
        EventsManager $events,
60
        Request $request,
61
        Router $router,
62
        Response $response,
63
        Extra $extra
64
    ) {
65
66 1
        parent::__construct($name);
67
68 1
        $this->setConfiguration($configuration);
69 1
        $this->setLogger($logger);
70 1
        $this->setCache($cache);
71 1
        $this->setEvents($events);
72 1
        $this->setRequest($request);
73 1
        $this->setRouter($router);
74 1
        $this->setResponse($response);
75 1
        $this->setExtra($extra);
76
77 1
    }
78
79
}
80