Completed
Push — master ( 95e37c...1f9e9c )
by
unknown
03:55
created

BpostInvalidXmlResponseException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 13
loc 13
rs 10
ccs 4
cts 4
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 2

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
namespace Bpost\BpostApiClient\Exception\BpostApiResponseException;
4
5
use Bpost\BpostApiClient\Exception\BpostApiResponseException;
6
7
/**
8
 * Class BpostInvalidXmlResponseException
9
 * @package Bpost\BpostApiClient\Exception\BpostApiResponseException
10
 */
11 View Code Duplication
class BpostInvalidXmlResponseException extends BpostApiResponseException
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...
12
{
13
    /**
14
     * @param string     $message
15
     * @param int        $code
16
     * @param \Exception $previous
0 ignored issues
show
Documentation introduced by
Should the type for parameter $previous not be null|\Exception?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
17
     */
18 1
    public function __construct($message = "", $code = 0, \Exception $previous = null)
19
    {
20 1
        $message = 'Invalid XML-response' . (empty($message) ? '' : ': ' . $message);
21 1
        parent::__construct($message, $code, $previous);
22 1
    }
23
}
24