Skip to content

Commit 5d2b5be

Browse files
committed
FIX cs & docblock
1 parent 03e7de4 commit 5d2b5be

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

app/code/Magento/Sales/Model/Order.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Directory\Model\Currency;
99
use Magento\Framework\Api\AttributeValueFactory;
1010
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\Exception\LocalizedException;
1112
use Magento\Framework\Locale\ResolverInterface;
1213
use Magento\Framework\Pricing\PriceCurrencyInterface;
1314
use Magento\Sales\Api\Data\OrderInterface;
@@ -981,7 +982,7 @@ public function setState($state)
981982
* Retrieve frontend label of order status
982983
*
983984
* @return string
984-
* @throws \Magento\Framework\Exception\LocalizedException
985+
* @throws LocalizedException
985986
*/
986987
public function getFrontendStatusLabel()
987988
{
@@ -992,7 +993,7 @@ public function getFrontendStatusLabel()
992993
* Retrieve label of order status
993994
*
994995
* @return string
995-
* @throws \Magento\Framework\Exception\LocalizedException
996+
* @throws LocalizedException
996997
*/
997998
public function getStatusLabel()
998999
{
@@ -1078,12 +1079,12 @@ public function place()
10781079

10791080
/**
10801081
* @return $this
1081-
* @throws \Magento\Framework\Exception\LocalizedException
1082+
* @throws LocalizedException
10821083
*/
10831084
public function hold()
10841085
{
10851086
if (!$this->canHold()) {
1086-
throw new \Magento\Framework\Exception\LocalizedException(__('A hold action is not available.'));
1087+
throw new LocalizedException(__('A hold action is not available.'));
10871088
}
10881089
$this->setHoldBeforeState($this->getState());
10891090
$this->setHoldBeforeStatus($this->getStatus());
@@ -1096,12 +1097,12 @@ public function hold()
10961097
* Attempt to unhold the order
10971098
*
10981099
* @return $this
1099-
* @throws \Magento\Framework\Exception\LocalizedException
1100+
* @throws LocalizedException
11001101
*/
11011102
public function unhold()
11021103
{
11031104
if (!$this->canUnhold()) {
1104-
throw new \Magento\Framework\Exception\LocalizedException(__('You cannot remove the hold.'));
1105+
throw new LocalizedException(__('You cannot remove the hold.'));
11051106
}
11061107

11071108
$this->setState($this->getHoldBeforeState())
@@ -1145,7 +1146,7 @@ public function isFraudDetected()
11451146
* @param string $comment
11461147
* @param bool $graceful
11471148
* @return $this
1148-
* @throws \Magento\Framework\Exception\LocalizedException
1149+
* @throws LocalizedException
11491150
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
11501151
*/
11511152
public function registerCancellation($comment = '', $graceful = true)
@@ -1184,7 +1185,7 @@ public function registerCancellation($comment = '', $graceful = true)
11841185
$this->addStatusHistoryComment($comment, false);
11851186
}
11861187
} elseif (!$graceful) {
1187-
throw new \Magento\Framework\Exception\LocalizedException(__('We cannot cancel this order.'));
1188+
throw new LocalizedException(__('We cannot cancel this order.'));
11881189
}
11891190
return $this;
11901191
}

app/code/Magento/Sales/Model/Order/Config.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66
namespace Magento\Sales\Model\Order;
7+
use Magento\Framework\Exception\LocalizedException;
78

89
/**
910
* Order configuration model
@@ -85,7 +86,7 @@ protected function _getCollection()
8586

8687
/**
8788
* @param string $state
88-
* @return Status|null
89+
* @return Status
8990
*/
9091
protected function _getState($state)
9192
{
@@ -101,7 +102,7 @@ protected function _getState($state)
101102
* Retrieve default status for state
102103
*
103104
* @param string $state
104-
* @return string
105+
* @return string|null
105106
*/
106107
public function getStateDefaultStatus($state)
107108
{
@@ -117,10 +118,10 @@ public function getStateDefaultStatus($state)
117118
/**
118119
* Retrieve status label
119120
*
120-
* @param string $code
121-
* @param null $forceArea
122-
* @return string
123-
* @throws \Magento\Framework\Exception\LocalizedException
121+
* @param string $code
122+
* @param string|null $forceArea
123+
* @return string
124+
* @throws LocalizedException
124125
*/
125126
public function getStatusLabel($code, $forceArea = null)
126127
{

0 commit comments

Comments
 (0)