AutomaticSecondPresentation   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
eloc 4
c 2
b 0
f 1
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toXML() 0 4 1
A createFromXML() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Bpost\BpostApiClient\Bpost\Order\Box\Option;
5
6
use Bpost\BpostApiClient\Common\XmlHelper;
7
use DOMDocument;
8
use DOMElement;
9
use SimpleXMLElement;
10
11
/**
12
 * bPost AutomaticSecondPresentation class
13
 *
14
 * @author    Tijs Verkoyen <[email protected]>
15
 *
16
 * @version   3.0.0
17
 *
18
 * @copyright Copyright (c), Tijs Verkoyen. All rights reserved.
19
 * @license   BSD License
20
 */
21
class AutomaticSecondPresentation extends Option
22
{
23
    /**
24
     * @throws \DOMException
25
     */
26
    public function toXML(DOMDocument $document, ?string $prefix = 'common'): DOMElement
27
    {
28
        return $document->createElement(
29
            XmlHelper::getPrefixedTagName('automaticSecondPresentation', $prefix)
30
        );
31
    }
32
33
    public static function createFromXML(SimpleXMLElement $xml): static
0 ignored issues
show
Unused Code introduced by
The parameter $xml is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

33
    public static function createFromXML(/** @scrutinizer ignore-unused */ SimpleXMLElement $xml): static

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

Loading history...
34
    {
35
        return new static();
36
    }
37
}