Code Duplication    Length = 23-23 lines in 2 locations

src/Entity/Customer.php 1 location

@@ 243-265 (lines=23) @@
240
     * @param \stdClass|array $data
241
     * @return CustomerInterface
242
     */
243
    public function populateFromApiResponse($data) : CustomerInterface
244
    {
245
        $data = DandomainFoundation\objectToArray($data);
246
247
        $this
248
            ->setExternalId($data['id'])
249
            ->setAddress($data['address'])
250
            ->setAddress2($data['address2'])
251
            ->setAttention($data['attention'])
252
            ->setCity($data['city'])
253
            ->setCountry($data['country'])
254
            ->setCountryId($data['countryId'])
255
            ->setEan($data['ean'])
256
            ->setEmail($data['email'])
257
            ->setFax($data['fax'])
258
            ->setName($data['name'])
259
            ->setPhone($data['phone'])
260
            ->setState($data['state'])
261
            ->setZipCode($data['zipCode'])
262
        ;
263
264
        return $this;
265
    }
266
267
    /**
268
     * @return int

src/Entity/Delivery.php 1 location

@@ 134-156 (lines=23) @@
131
     * @param \stdClass|array $data
132
     * @return DeliveryInterface
133
     */
134
    public function populateFromApiResponse($data) : DeliveryInterface
135
    {
136
        $data = DandomainFoundation\objectToArray($data);
137
138
        $this
139
            ->setAddress($data['address'])
140
            ->setAddress2($data['address2'])
141
            ->setAttention($data['attention'])
142
            ->setCity($data['city'])
143
            ->setCountry($data['country'])
144
            ->setCountryId($data['countryId'])
145
            ->setCvr($data['cvr'])
146
            ->setEan($data['ean'])
147
            ->setEmail($data['email'])
148
            ->setFax($data['fax'])
149
            ->setName($data['name'])
150
            ->setPhone($data['phone'])
151
            ->setState($data['state'])
152
            ->setZipCode($data['zipCode'])
153
        ;
154
155
        return $this;
156
    }
157
158
    /**
159
     * @return integer