StandartSlackRoom   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 35.71 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 10 10 1
A driver() 0 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
 * This file is part of GitterBot package.
4
 *
5
 * @author butschster <[email protected]>
6
 * @date   20.07.2016 15:27
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Interfaces\Slack;
13
14
use Domains\Room\AbstractRoom;
15
16
class StandartSlackRoom extends AbstractRoom
17
{
18
    /**
19
     * AbstractRoom constructor.
20
     *
21
     * @param string $id
22
     * @param string|array $groups
23
     * @param array  $middleware
24
     */
25 View Code Duplication
    public function __construct($id, $groups = '*', array $middleware = [])
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...
26
    {
27
        parent::__construct();
28
29
        $this->id = $id;
30
        $this->alias = $id;
31
        $this->groups = (array) $groups;
32
33
        $this->setMiddleware($middleware);
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function driver()
40
    {
41
        return 'slack';
42
    }
43
}