ParcelLockerReducedMobilityZone::toXml()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
namespace Bpost\BpostApiClient\Bpost\Order\Box\National;
3
4
use Bpost\BpostApiClient\Common\ComplexAttribute;
5
6
class ParcelLockerReducedMobilityZone extends ComplexAttribute
7
{
8
9
    /**
10
     * @param \DOMDocument $document
11
     * @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...
12
     * @param string       $type
0 ignored issues
show
Documentation introduced by
Should the type for parameter $type 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...
13
     * @return \DOMElement
14
     */
15 2
    function toXml(\DOMDocument $document, $prefix = null, $type = null)
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
    {
17 2
        $tagName = $this->getPrefixedTagName('parcelLockerReducedMobilityZone', $prefix);
18
19 2
        $xml = $document->createElement($tagName);
20
21 2
        return $xml;
22
    }
23
24
    /**
25
     * @todo Implement it, because today, nothing is specified
26
     * @param \SimpleXMLElement $xml
27
     * @return ParcelLockerReducedMobilityZone|\Bpost\BpostApiClient\IComplexAttribute
28
     */
29 2
    static function createFromXml(\SimpleXMLElement $xml)
0 ignored issues
show
Unused Code introduced by
The parameter $xml is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
30
    {
31 2
        $self = new self();
32 2
        return $self;
33
    }
34
}
35