Code Duplication    Length = 12-14 lines in 3 locations

src/YahooShoppingJp/Request/UpdateOrderShippingStatusRequest.php 3 locations

@@ 167-180 (lines=14) @@
164
     * @param string $shipNotes
165
     * @return self
166
     */
167
    public function setShipNotes(string $shipNotes): self
168
    {
169
        if (isset($this->params['Order']['Ship']['ShipNotes'])) {
170
            throw new LogicException('ShipNotes is already set.');
171
        }
172
173
        if (strlen($shipNotes) > 500) {
174
            throw new InvalidArgumentException('ShipNotes is invalid.');
175
        }
176
177
        $this->params['Order']['Ship']['ShipNotes'] = $shipNotes;
178
179
        return $this;
180
    }
181
182
    /**
183
     * @param string $shipInvoiceNumber1
@@ 231-242 (lines=12) @@
228
     * @param \DateTimeImmutable $shipDate
229
     * @return self
230
     */
231
    public function setShipDate(\DateTimeImmutable $shipDate): self
232
    {
233
        if (isset($this->params['Order']['Ship']['ShipDate'])) {
234
            throw new LogicException('ShipDate is already set.');
235
        }
236
237
        $this->params['Order']['Ship']['ShipDate'] = $shipDate
238
            ->setTimeZone(new DateTimeZone('Asia/Tokyo'))
239
            ->format('Ymd');
240
241
        return $this;
242
    }
243
244
    /**
245
     * @param \DateTimeImmutable $arrivalDate
@@ 248-259 (lines=12) @@
245
     * @param \DateTimeImmutable $arrivalDate
246
     * @return self
247
     */
248
    public function setArrivalDate(\DateTimeImmutable $arrivalDate): self
249
    {
250
        if (isset($this->params['Order']['Ship']['ArrivalDate'])) {
251
            throw new LogicException('ArrivalDate is already set.');
252
        }
253
254
        $this->params['Order']['Ship']['ArrivalDate'] = $arrivalDate
255
            ->setTimeZone(new DateTimeZone('Asia/Tokyo'))
256
            ->format('Ymd');
257
258
        return $this;
259
    }
260
261
}
262