Skip to content

Commit f52d0fa

Browse files
committed
Fix #13278 - Wrong return type in Salesrule Module RuleInterface.php
1 parent 62b8f8a commit f52d0fa

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

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

Lines changed: 13 additions & 11 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';
@@ -59,14 +61,14 @@ public function setName($name);
5961
/**
6062
* Get display label
6163
*
62-
* @return \Magento\SalesRule\Api\Data\RuleLabelInterface[]|null
64+
* @return RuleLabelInterface[]|null
6365
*/
6466
public function getStoreLabels();
6567

6668
/**
6769
* Set display label
6870
*
69-
* @param \Magento\SalesRule\Api\Data\RuleLabelInterface[]|null $storeLabels
71+
* @param RuleLabelInterface[]|null $storeLabels
7072
* @return $this
7173
*/
7274
public function setStoreLabels(array $storeLabels = null);
@@ -173,36 +175,36 @@ 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

180182
/**
181183
* Get condition for the rule
182184
*
183-
* @return \Magento\SalesRule\Api\Data\ConditionInterface|null
185+
* @return ConditionInterface|null
184186
*/
185187
public function getCondition();
186188

187189
/**
188190
* Set condition for the rule
189191
*
190-
* @param \Magento\SalesRule\Api\Data\ConditionInterface|null $condition
192+
* @param ConditionInterface|null $condition
191193
* @return $this
192194
*/
193195
public function setCondition(ConditionInterface $condition = null);
194196

195197
/**
196198
* Get action condition
197199
*
198-
* @return \Magento\SalesRule\Api\Data\ConditionInterface|null
200+
* @return ConditionInterface|null
199201
*/
200202
public function getActionCondition();
201203

202204
/**
203205
* Set action condition
204206
*
205-
* @param \Magento\SalesRule\Api\Data\ConditionInterface|null $actionCondition
207+
* @param ConditionInterface|null $actionCondition
206208
* @return $this
207209
*/
208210
public function setActionCondition(ConditionInterface $actionCondition = null);
@@ -436,15 +438,15 @@ public function setSimpleFreeShipping($simpleFreeShipping);
436438
/**
437439
* Retrieve existing extension attributes object or create a new one.
438440
*
439-
* @return \Magento\SalesRule\Api\Data\RuleExtensionInterface|null
441+
* @return RuleExtensionInterface|null
440442
*/
441443
public function getExtensionAttributes();
442444

443445
/**
444446
* Set an extension attributes object.
445447
*
446-
* @param \Magento\SalesRule\Api\Data\RuleExtensionInterface $extensionAttributes
448+
* @param RuleExtensionInterface $extensionAttributes
447449
* @return $this
448450
*/
449-
public function setExtensionAttributes(\Magento\SalesRule\Api\Data\RuleExtensionInterface $extensionAttributes);
451+
public function setExtensionAttributes(RuleExtensionInterface $extensionAttributes);
450452
}

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)