Code Duplication    Length = 9-10 lines in 8 locations

src/YahooShoppingJp/Request/UpdateOrderStatusRequest.php 2 locations

@@ 128-136 (lines=9) @@
125
     * @param OrderStatus $orderStatus
126
     * @return self
127
     */
128
    public function setOrderStatus(OrderStatus $orderStatus): self
129
    {
130
        if (isset($this->params['Order']['OrderStatus'])) {
131
            throw new LogicException('OrderStatus is already set.');
132
        }
133
        $this->params['Order']['OrderStatus'] = $orderStatus->getValue();
134
135
        return $this;
136
    }
137
138
    /**
139
     * 更新者名(ビジネスID登録氏名)
@@ 161-170 (lines=10) @@
158
     * @param CancelReason $cancelReason
159
     * @return self
160
     */
161
    public function setCancelReason(CancelReason $cancelReason): self
162
    {
163
        if (isset($this->params['Order']['CancelReason'])) {
164
            throw new LogicException('CancelReason is already set.');
165
        }
166
167
        $this->params['Order']['CancelReason'] = $cancelReason->getValue();
168
169
        return $this;
170
    }
171
172
}
173

src/YahooShoppingJp/Request/UpdateOrderShippingStatusRequest.php 2 locations

@@ 137-146 (lines=10) @@
134
     * @param ShipStatus $shipStatus
135
     * @return self
136
     */
137
    public function setShipStatus(ShipStatus $shipStatus): self
138
    {
139
        if (isset($this->params['Order']['Ship']['ShipStatus'])) {
140
            throw new LogicException('ShipStatus is already set.');
141
        }
142
143
        $this->params['Order']['Ship']['ShipStatus'] = $shipStatus->getValue();
144
145
        return $this;
146
    }
147
148
    /**
149
     * @param ShipMethod $shipMethod
@@ 152-161 (lines=10) @@
149
     * @param ShipMethod $shipMethod
150
     * @return self
151
     */
152
    public function setShipMethod(ShipMethod $shipMethod): self
153
    {
154
        if (isset($this->params['Order']['Ship']['ShipMethod'])) {
155
            throw new LogicException('ShipMethod is already set.');
156
        }
157
158
        $this->params['Order']['Ship']['ShipMethod'] = $shipMethod->getValue();
159
160
        return $this;
161
    }
162
163
    /**
164
     * @param string $shipNotes

src/YahooShoppingJp/Request/UpdateOrderInfoRequest.php 4 locations

@@ 124-133 (lines=10) @@
121
     * @param SuspectFlag $suspectFlag
122
     * @return UpdateOrderInfoRequest
123
     */
124
    public function setSuspect(SuspectFlag $suspectFlag): self
125
    {
126
        if (isset($this->params['Order']['Suspect'])) {
127
            throw new LogicException('Suspect is already set.');
128
        }
129
        $this->params['Order']['Suspect'] = $suspectFlag->getValue();
130
131
        return $this;
132
    }
133
134
    /**
135
     * 支払い分類
136
     *
@@ 140-149 (lines=10) @@
137
     * @param PayType $payType
138
     * @return UpdateOrderInfoRequest
139
     */
140
    public function setPayType(PayType $payType): self
141
    {
142
        if (isset($this->params['Order']['PayType'])) {
143
            throw new LogicException('PayType is already set.');
144
        }
145
        $this->params['Order']['PayType'] = $payType->getValue();
146
147
        return $this;
148
    }
149
150
    /**
151
     * 支払い種別
152
     *
@@ 156-164 (lines=9) @@
153
     * @param PayKind $payKind
154
     * @return UpdateOrderInfoRequest
155
     */
156
    public function setPayKind(PayKind $payKind): self
157
    {
158
        if (isset($this->params['Order']['PayKind'])) {
159
            throw new LogicException('PayKind is already set.');
160
        }
161
        $this->params['Order']['PayKind'] = $payKind->getValue();
162
163
        return $this;
164
    }
165
166
    /**
167
     * 支払い方法
@@ 172-180 (lines=9) @@
169
     * @param PayMethod $payMethod
170
     * @return UpdateOrderInfoRequest
171
     */
172
    public function setPayMethod(PayMethod $payMethod): self
173
    {
174
        if (isset($this->params['Order']['PayMethod'])) {
175
            throw new LogicException('PayMethod is already set.');
176
        }
177
        $this->params['Order']['PayMethod'] = $payMethod->getValue();
178
179
        return $this;
180
    }
181
182
    /**
183
     * 支払い方法名称