Skip to content

Commit 9d362e7

Browse files
ENGCOM-3729: Refactoring magento sales sequence #19930
- Merge Pull Request #19930 from agorbulin/magento2:Refactoring-Magento_SalesSequence - Merged commits: 1. 606e31c 2. bc2001f
2 parents 21c719e + bc2001f commit 9d362e7

File tree

6 files changed

+21
-7
lines changed

6 files changed

+21
-7
lines changed

app/code/Magento/SalesRule/Model/Coupon.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ protected function _construct()
3939
/**
4040
* Set rule instance
4141
*
42-
* @param \Magento\SalesRule\Model\Rule $rule
42+
* @param Rule $rule
4343
* @return $this
4444
*/
45-
public function setRule(\Magento\SalesRule\Model\Rule $rule)
45+
public function setRule(Rule $rule)
4646
{
4747
$this->setRuleId($rule->getId());
4848
return $this;
@@ -51,7 +51,7 @@ public function setRule(\Magento\SalesRule\Model\Rule $rule)
5151
/**
5252
* Load primary coupon for specified rule
5353
*
54-
* @param \Magento\SalesRule\Model\Rule|int $rule
54+
* @param Rule|int $rule
5555
* @return $this
5656
*/
5757
public function loadPrimaryByRule($rule)

app/code/Magento/SalesSequence/Model/Manager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public function __construct(
4141
*
4242
* @param string $entityType
4343
* @param int $storeId
44+
*
4445
* @return \Magento\Framework\DB\Sequence\SequenceInterface
46+
* @throws \Magento\Framework\Exception\LocalizedException
4547
*/
4648
public function getSequence($entityType, $storeId)
4749
{

app/code/Magento/SalesSequence/Model/ResourceModel/Meta.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ public function loadByEntityTypeAndStore($entityType, $storeId)
9696
* Using for load sequence profile and setting it into metadata
9797
*
9898
* @param \Magento\Framework\Model\AbstractModel $object
99-
* @return $this
99+
*
100+
* @return $this|\Magento\Framework\Model\ResourceModel\Db\AbstractDb
101+
* @throws \Magento\Framework\Exception\LocalizedException
100102
*/
101103
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
102104
{
@@ -137,7 +139,12 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
137139
}
138140

139141
/**
140-
* @inheritdoc
142+
* Perform actions after object save
143+
*
144+
* @param \Magento\Framework\Model\AbstractModel $object
145+
*
146+
* @return $this|\Magento\Framework\Model\ResourceModel\Db\AbstractDb
147+
* @throws \Magento\Framework\Exception\AlreadyExistsException
141148
*/
142149
protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
143150
{

app/code/Magento/SalesSequence/Model/ResourceModel/Profile.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\SalesSequence\Model\ResourceModel;
77

8-
use Magento\SalesSequence\Model\Meta as ModelMeta;
98
use Magento\Framework\Model\ResourceModel\Db\Context as DatabaseContext;
109
use Magento\SalesSequence\Model\ProfileFactory;
1110

app/code/Magento/SalesSequence/Observer/SequenceCreatorObserver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ public function __construct(
4949
}
5050

5151
/**
52+
* Observer triggered during adding new store
53+
*
5254
* @param EventObserver $observer
53-
* @return $this
55+
*
56+
* @return $this|void
57+
* @throws \Magento\Framework\Exception\AlreadyExistsException
5458
*/
5559
public function execute(EventObserver $observer)
5660
{

app/code/Magento/SalesSequence/Setup/SequenceCreator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public function __construct(
4949

5050
/**
5151
* Creates sales sequences.
52+
*
53+
* @throws \Magento\Framework\Exception\AlreadyExistsException
5254
*/
5355
public function create()
5456
{

0 commit comments

Comments
 (0)