Completed
Push — master ( d89681...8e123d )
by Andreas
20s
created

Error   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A getMessage() 4 4 1
A getThrowable() 4 4 1
A getConference() 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
 * Copyright (c) Andreas Heigl<[email protected]
5
 *
6
 * Licensed under the MIT License. See LICENSE.md file in the project root
7
 * for full license information.
8
 */
9
10
namespace Callingallpapers\ResultKeeper;
11
12
use Throwable;
13
14 View Code Duplication
class Error implements Result
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...
15
{
16
    private $conference;
17
18
    private $throwable;
19
20
    public function __construct(string $conference, Throwable $throwable)
21
    {
22
        $this->conference = $conference;
23
        $this->throwable  = $throwable;
24
    }
25
26
    public function getMessage() : string
27
    {
28
        return $this->throwable->getMessage();
29
    }
30
31
    public function getThrowable() : Throwable
32
    {
33
        return $this->throwable;
34
    }
35
36
    public function getConference(): string
37
    {
38
        return $this->conference;
39
    }
40
}
41