Code Duplication    Length = 12-18 lines in 5 locations

src/Entity/Tradeability/FreightCharges.php 1 location

@@ 28-39 (lines=12) @@
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('FreightCharges');
35
        $node->appendChild($document->createElement('MonetaryValue', $this->getMonetaryValue()));
36
        $node->appendChild($document->createElement('CurrencyCode', $this->getCurrencyCode()));
37
38
        return $node;
39
    }
40
41
    /**
42
     * @return mixed

src/Entity/Tradeability/UnitPrice.php 1 location

@@ 30-47 (lines=18) @@
27
     *
28
     * @return DOMElement
29
     */
30
    public function toNode(DOMDocument $document = null)
31
    {
32
        if (null === $document) {
33
            $document = new DOMDocument();
34
        }
35
36
        $node = $document->createElement('UnitPrice');
37
38
        // Required
39
        $node->appendChild($document->createElement('MonetaryValue', $this->getMonetaryValue()));
40
41
        // Optional
42
        if ($this->getCurrencyCode() !== null) {
43
            $node->appendChild($document->createElement('CurrencyCode', $this->getCurrencyCode()));
44
        }
45
46
        return $node;
47
    }
48
49
    /**
50
     * @return float

src/Entity/AccessPointCOD.php 1 location

@@ 45-57 (lines=13) @@
42
     * @param null|DOMDocument $document
43
     * @return DOMElement
44
     */
45
    public function toNode(DOMDocument $document = null)
46
    {
47
        if (null === $document) {
48
            $document = new DOMDocument();
49
        }
50
51
        $node = $document->createElement('AccessPointCOD');
52
53
        $node->appendChild($document->createElement('CurrencyCode', $this->getCurrencyCode()));
54
        $node->appendChild($document->createElement('MonetaryValue', $this->getMonetaryValue()));
55
56
        return $node;
57
    }
58
59
    /**
60
     * @return string

src/Entity/InsuredValue.php 1 location

@@ 42-53 (lines=12) @@
39
     * @param null|DOMDocument $document
40
     * @return DOMElement
41
     */
42
    public function toNode(DOMDocument $document = null)
43
    {
44
        if (null === $document) {
45
            $document = new DOMDocument();
46
        }
47
48
        $node = $document->createElement('InsuredValue');
49
        $node->appendChild($document->createElement('CurrencyCode', $this->getCurrencyCode()));
50
        $node->appendChild($document->createElement('MonetaryValue', $this->getMonetaryValue()));
51
52
        return $node;
53
    }
54
55
    /**
56
     * @return string|null

src/Entity/InvoiceLineTotal.php 1 location

@@ 30-45 (lines=16) @@
27
     * @param null|DOMDocument $document
28
     * @return DOMElement
29
     */
30
    public function toNode(DOMDocument $document = null)
31
    {
32
        if (null === $document) {
33
            $document = new DOMDocument();
34
        }
35
36
        $node = $document->createElement('InvoiceLineTotal');
37
38
        if ($this->getCurrencyCode()) {
39
            $node->appendChild($document->createElement('CurrencyCode', $this->getCurrencyCode()));
40
        }
41
42
        $node->appendChild($document->createElement('MonetaryValue', $this->getMonetaryValue()));
43
44
        return $node;
45
    }
46
47
    /**
48
     * @return mixed