Skip to content

Commit fb3b977

Browse files
committed
Add specific type hints and docblocks for Quote\Address\Total
1 parent 1aaa2fc commit fb3b977

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

app/code/Magento/Quote/Model/Quote.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ public function collectTotals()
19441944
/**
19451945
* Get all quote totals (sorted by priority)
19461946
*
1947-
* @return array
1947+
* @return Address\Total[]
19481948
*/
19491949
public function getTotals()
19501950
{

app/code/Magento/Quote/Model/Quote/Address/Total.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Quote\Model\Quote\Address;
77

8+
/**
9+
* @method string getCode()
10+
*/
811
class Total extends \Magento\Framework\DataObject
912
{
1013
/**

app/code/Magento/Quote/Model/Quote/TotalsReader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(
3535
/**
3636
* @param \Magento\Quote\Model\Quote $quote
3737
* @param array $total
38-
* @return array
38+
* @return Total[]
3939
*/
4040
public function fetch(\Magento\Quote\Model\Quote $quote, array $total)
4141
{
@@ -62,7 +62,7 @@ public function fetch(\Magento\Quote\Model\Quote $quote, array $total)
6262

6363
/**
6464
* @param array $total
65-
* @return Total|array
65+
* @return Total|Total[]
6666
*/
6767
protected function convert($total)
6868
{
@@ -85,10 +85,10 @@ protected function convert($total)
8585

8686
/**
8787
* @param Total $totalInstance
88-
* @param array $output
89-
* @return array
88+
* @param Total[] $output
89+
* @return Total[]
9090
*/
91-
protected function merge($totalInstance, $output)
91+
protected function merge(Total $totalInstance, $output)
9292
{
9393
if (array_key_exists($totalInstance->getCode(), $output)) {
9494
$output[$totalInstance->getCode()] = $output[$totalInstance->getCode()]->addData(

0 commit comments

Comments
 (0)