Signature   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 19
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toXML() 9 9 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
namespace Bpost\BpostApiClient\Bpost\Order\Box\Option;
3
4
/**
5
 * bPost Signature class
6
 *
7
 * @author    Tijs Verkoyen <[email protected]>
8
 * @version   3.0.0
9
 * @copyright Copyright (c), Tijs Verkoyen. All rights reserved.
10
 * @license   BSD License
11
 */
12 View Code Duplication
class Signature extends Option
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...
13
{
14
    /**
15
     * Return the object as an array for usage in the XML
16
     *
17
     * @param  \DomDocument $document
18
     * @param  string       $prefix
0 ignored issues
show
Documentation introduced by
Should the type for parameter $prefix not be string|null?

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...
19
     * @return \DomElement
20
     */
21 1
    public function toXML(\DOMDocument $document, $prefix = null)
22
    {
23 1
        $tagName = 'signed';
24 1
        if ($prefix !== null) {
25 1
            $tagName = $prefix . ':' . $tagName;
26 1
        }
27
28 1
        return $document->createElement($tagName);
29
    }
30
}
31