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

DeliveryConfirmation::setDcisType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
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