Code Duplication    Length = 9-11 lines in 2 locations

src/Entity/PackageWeight.php 1 location

@@ 27-35 (lines=9) @@
24
     */
25
    private $weight;
26
27
    public function __construct($attributes = null)
28
    {
29
        $this->setUnitOfMeasurement(new UnitOfMeasurement(
30
            isset($attributes->UnitOfMeasurement) ? $attributes->UnitOfMeasurement : null
31
        ));
32
        if (isset($attributes->Weight)) {
33
            $this->setWeight($attributes->Weight);
34
        }
35
    }
36
37
    /**
38
     * @param null|DOMDocument $document

src/Entity/ShipmentTotalWeight.php 1 location

@@ 15-25 (lines=11) @@
12
    private $unitOfMeasurement;
13
    private $Weight;
14
15
    public function __construct($response = null)
16
    {
17
        if (null !== $response) {
18
            if (isset($response->unitOfMeasurement)) {
19
                $this->setUnitOfMeasurement($response->unitOfMeasurement);
20
            }
21
            if (isset($response->Weight)) {
22
                $this->setWeight($response->Weight);
23
            }
24
        }
25
    }
26
27
    /**
28
     * @param null|DOMDocument $document