-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean code #18124
Clean code #18124
Changes from 1 commit
1e4dd7d
46fdf6d
1b5f7c5
7aeb3be
cdd19a6
9dc3345
1ce85bb
ffc7593
09c9d74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,15 +26,19 @@ public function __construct($entities) | |
} | ||
|
||
/** | ||
* Get | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, add a comment that describes service method |
||
* | ||
* @param int $entityId | ||
* @return \Magento\Framework\DataObject|null | ||
*/ | ||
public function get($entityId) | ||
{ | ||
return isset($this->entitiesMap[$entityId]) ? $this->entitiesMap[$entityId] : null; | ||
return $this->entitiesMap[$entityId] ?? null; | ||
} | ||
|
||
/** | ||
* List | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, add a comment that describes service method |
||
* | ||
* @return \Magento\Framework\DataObject[] | ||
*/ | ||
public function getList() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ public function _beforeToHtml() | |
*/ | ||
public function getWebsiteCount($websiteId) | ||
{ | ||
return isset($this->_websiteCounts[$websiteId]) ? $this->_websiteCounts[$websiteId] : 0; | ||
return $this->_websiteCounts[$websiteId] ?? 0; | ||
} | ||
|
||
/** | ||
|
@@ -166,13 +166,15 @@ public function getTotals() | |
return $this->_collection->getTotals(); | ||
} | ||
|
||
/** | ||
* Format price by specified website | ||
* | ||
* @param float $price | ||
* @param null|int $websiteId | ||
* @return string | ||
*/ | ||
/** | ||
* Format price by specified website | ||
* | ||
* @param float $price | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, remove extra spaces from doc block There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, check comment indentation |
||
* @param null|int $websiteId | ||
* | ||
* @return string | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function formatCurrency($price, $websiteId = null) | ||
{ | ||
return $this->_storeManager->getWebsite($websiteId)->getBaseCurrency()->format($price); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -982,11 +982,12 @@ public function getCode($type, $code = '') | |
} | ||
} | ||
|
||
/** | ||
* Return FeDex currency ISO code by Magento Base Currency Code | ||
* | ||
* @return string 3-digit currency code | ||
*/ | ||
/** | ||
* Return FeDex currency ISO code by Magento Base Currency Code | ||
* | ||
* @return string 3-digit currency code | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, check comment indentation |
||
public function getCurrencyCode() | ||
{ | ||
$codes = [ | ||
|
@@ -1008,7 +1009,7 @@ public function getCurrencyCode() | |
]; | ||
$currencyCode = $this->_storeManager->getStore()->getBaseCurrencyCode(); | ||
|
||
return isset($codes[$currencyCode]) ? $codes[$currencyCode] : $currencyCode; | ||
return $codes[$currencyCode] ?? $currencyCode; | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove extra spaces from doc block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check comment indentation