Skip to content

Commit 65b9a55

Browse files
ENGCOM-6044: Fix #13278 - Wrong return type in Salesrule Module RuleInterface.php #24814
2 parents c571391 + 7ebfa8c commit 65b9a55

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

app/code/Magento/SalesRule/Api/Data/RuleInterface.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
*/
66
namespace Magento\SalesRule\Api\Data;
77

8+
use Magento\Framework\Api\ExtensibleDataInterface;
9+
810
/**
911
* Interface RuleInterface
1012
*
1113
* @api
1214
* @since 100.0.2
1315
*/
14-
interface RuleInterface extends \Magento\Framework\Api\ExtensibleDataInterface
16+
interface RuleInterface extends ExtensibleDataInterface
1517
{
1618
const FREE_SHIPPING_NONE = 'NONE';
1719
const FREE_SHIPPING_MATCHING_ITEMS_ONLY = 'MATCHING_ITEMS_ONLY';
@@ -173,7 +175,7 @@ public function getIsActive();
173175
* Set whether the coupon is active
174176
*
175177
* @param bool $isActive
176-
* @return bool
178+
* @return $this
177179
*/
178180
public function setIsActive($isActive);
179181

@@ -232,6 +234,8 @@ public function setStopRulesProcessing($stopRulesProcessing);
232234
public function getIsAdvanced();
233235

234236
/**
237+
* Set if rule is advanced
238+
*
235239
* @param bool $isAdvanced
236240
* @return $this
237241
*/
@@ -260,6 +264,8 @@ public function setProductIds(array $productIds = null);
260264
public function getSortOrder();
261265

262266
/**
267+
* Set sort order
268+
*
263269
* @param int $sortOrder
264270
* @return $this
265271
*/
@@ -446,5 +452,5 @@ public function getExtensionAttributes();
446452
* @param \Magento\SalesRule\Api\Data\RuleExtensionInterface $extensionAttributes
447453
* @return $this
448454
*/
449-
public function setExtensionAttributes(\Magento\SalesRule\Api\Data\RuleExtensionInterface $extensionAttributes);
455+
public function setExtensionAttributes(RuleExtensionInterface $extensionAttributes);
450456
}

app/code/Magento/SalesRule/Model/Data/Rule.php

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@
55
* Copyright © Magento, Inc. All rights reserved.
66
* See COPYING.txt for license details.
77
*/
8+
declare(strict_types=1);
9+
810
namespace Magento\SalesRule\Model\Data;
911

12+
use Magento\Framework\Api\AbstractExtensibleObject;
1013
use Magento\SalesRule\Api\Data\ConditionInterface;
14+
use Magento\SalesRule\Api\Data\RuleExtensionInterface;
1115
use Magento\SalesRule\Api\Data\RuleInterface;
16+
use Magento\SalesRule\Api\Data\RuleLabelInterface;
1217

1318
/**
1419
* Class Rule
1520
*
1621
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
1722
* @codeCoverageIgnore
1823
*/
19-
class Rule extends \Magento\Framework\Api\AbstractExtensibleObject implements RuleInterface
24+
class Rule extends AbstractExtensibleObject implements RuleInterface
2025
{
2126
const KEY_RULE_ID = 'rule_id';
2227
const KEY_NAME = 'name';
@@ -187,7 +192,7 @@ public function getIsActive()
187192
* Set whether the coupon is active
188193
*
189194
* @param bool $isActive
190-
* @return bool
195+
* @return $this
191196
*/
192197
public function setIsActive($isActive)
193198
{
@@ -197,7 +202,7 @@ public function setIsActive($isActive)
197202
/**
198203
* Get condition for the rule
199204
*
200-
* @return \Magento\SalesRule\Api\Data\ConditionInterface|null
205+
* @return ConditionInterface|null
201206
*/
202207
public function getCondition()
203208
{
@@ -207,7 +212,7 @@ public function getCondition()
207212
/**
208213
* Set condition for the rule
209214
*
210-
* @param \Magento\SalesRule\Api\Data\ConditionInterface|null $condition
215+
* @param ConditionInterface|null $condition
211216
* @return $this
212217
*/
213218
public function setCondition(ConditionInterface $condition = null)
@@ -218,7 +223,7 @@ public function setCondition(ConditionInterface $condition = null)
218223
/**
219224
* Get action condition
220225
*
221-
* @return \Magento\SalesRule\Api\Data\ConditionInterface|null
226+
* @return ConditionInterface|null
222227
*/
223228
public function getActionCondition()
224229
{
@@ -228,7 +233,7 @@ public function getActionCondition()
228233
/**
229234
* Set action condition
230235
*
231-
* @param \Magento\SalesRule\Api\Data\ConditionInterface|null $actionCondition
236+
* @param ConditionInterface|null $actionCondition
232237
* @return $this
233238
*/
234239
public function setActionCondition(ConditionInterface $actionCondition = null)
@@ -283,7 +288,7 @@ public function setIsAdvanced($isAdvanced)
283288
/**
284289
* Get display label
285290
*
286-
* @return \Magento\SalesRule\Api\Data\RuleLabelInterface[]|null
291+
* @return RuleLabelInterface[]|null
287292
*/
288293
public function getStoreLabels()
289294
{
@@ -293,7 +298,7 @@ public function getStoreLabels()
293298
/**
294299
* Set display label
295300
*
296-
* @param \Magento\SalesRule\Api\Data\RuleLabelInterface[]|null $storeLabels
301+
* @param RuleLabelInterface[]|null $storeLabels
297302
* @return $this
298303
*/
299304
public function setStoreLabels(array $storeLabels = null)
@@ -622,7 +627,7 @@ public function setSimpleFreeShipping($simpleFreeShipping)
622627
/**
623628
* @inheritdoc
624629
*
625-
* @return \Magento\SalesRule\Api\Data\RuleExtensionInterface|null
630+
* @return RuleExtensionInterface|null
626631
*/
627632
public function getExtensionAttributes()
628633
{
@@ -632,11 +637,11 @@ public function getExtensionAttributes()
632637
/**
633638
* @inheritdoc
634639
*
635-
* @param \Magento\SalesRule\Api\Data\RuleExtensionInterface $extensionAttributes
640+
* @param RuleExtensionInterface $extensionAttributes
636641
* @return $this
637642
*/
638643
public function setExtensionAttributes(
639-
\Magento\SalesRule\Api\Data\RuleExtensionInterface $extensionAttributes
644+
RuleExtensionInterface $extensionAttributes
640645
) {
641646
return $this->_setExtensionAttributes($extensionAttributes);
642647
}

0 commit comments

Comments
 (0)