Completed
Pull Request — master (#189)
by
unknown
06:49
created

DeliveryConfirmation   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A toNode() 0 12 2
A getDcisType() 0 4 1
A setDcisType() 0 6 1
1
<?php
2
3
namespace Ups\Entity;
4
5
use DOMDocument;
6
use DOMElement;
7
use Ups\NodeInterface;
8
9
/**
10
 * Class DeliveryConfirmation
11
 * @package Ups\Entity
12
 */
13
class DeliveryConfirmation implements NodeInterface
14
{
15
    /**
16
     * @var
17
     *
18
     * 1 => 'Delivery Confirmation Signature Required'
19
     * 2 => 'Delivery Confirmation Adult Signature Required.'
20
     */
21
    private $dcisType = 1;
22
23
    /**
24
     * @param null|DOMDocument $document
25
     *
26
     * @return DOMElement
27
     */
28
    public function toNode(DOMDocument $document = null)
29
    {
30
        if (null === $document) {
31
            $document = new DOMDocument();
32
        }
33
34
        $node = $document->createElement('DeliveryConfirmation');
35
36
        $node->appendChild($document->createElement('DCISType', $this->getDcisType()));
37
38
        return $node;
39
    }
40
41
    /**
42
     * @param mixed $SaturdayPickup
0 ignored issues
show
Bug introduced by
There is no parameter named $SaturdayPickup. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
43
     * @return $this
44
     */
45
    public function getDcisType()
46
    {
47
        return $this->dcisType;
48
    }
49
50
    /**
51
     * @param mixed $dcisTypeId
52
     * @return $this
53
     */
54
    public function setDcisType($dcisTypeId)
55
    {
56
        $this->dcisType = $dcisTypeId;
57
58
        return $this;
59
    }
60
61
}
62