Skip to content

Commit 7606dd0

Browse files
committed
Fix static test failures
1 parent 414b090 commit 7606dd0

File tree

8 files changed

+34
-7
lines changed

8 files changed

+34
-7
lines changed

app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Form.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
class Form extends \Magento\Backend\Block\Widget\Form\Generic
1212
{
1313
/**
14+
* Prepare the form
15+
*
1416
* @return $this
1517
*/
1618
protected function _prepareForm()

app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tabs.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
class Tabs extends \Magento\Backend\Block\Widget\Tabs
1212
{
1313
/**
14+
* Initialise the block
15+
*
1416
* @return void
1517
*/
1618
protected function _construct()
@@ -22,6 +24,8 @@ protected function _construct()
2224
}
2325

2426
/**
27+
* Add rating information tab
28+
*
2529
* @return $this
2630
*/
2731
protected function _beforeToHtml()

app/code/Magento/Review/Block/Customer/View.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,14 @@ public function getTotalReviews()
182182
{
183183
if (!$this->getTotalReviewsCache()) {
184184
$this->setTotalReviewsCache(
185-
$this->_reviewFactory->create()->getTotalReviews($this->getProductData()->getId()),
186-
false,
187-
$this->_storeManager->getStore()->getId()
185+
$this->_reviewFactory->create()->getTotalReviews(
186+
$this->getProductData()->getId(),
187+
false,
188+
$this->_storeManager->getStore()->getId()
189+
)
188190
);
189191
}
192+
190193
return $this->getTotalReviewsCache();
191194
}
192195

app/code/Magento/Review/Block/Form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ class Form extends \Magento\Framework\View\Element\Template
7171
private $serializer;
7272

7373
/**
74-
* Form constructor.
75-
*
7674
* @param \Magento\Framework\View\Element\Template\Context $context
7775
* @param \Magento\Framework\Url\EncoderInterface $urlEncoder
7876
* @param \Magento\Review\Helper\Data $reviewData
@@ -140,6 +138,8 @@ protected function _construct()
140138
}
141139

142140
/**
141+
* Return JavaScript layout object
142+
*
143143
* @return string
144144
*/
145145
public function getJsLayout()

app/code/Magento/Review/Model/Rating.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ protected function _construct()
7474
}
7575

7676
/**
77+
* Add a vote to an option
78+
*
7779
* @param int $optionId
7880
* @param int $entityPkValue
7981
* @return $this
@@ -93,6 +95,8 @@ public function addOptionVote($optionId, $entityPkValue)
9395
}
9496

9597
/**
98+
* Update a vote for an option
99+
*
96100
* @param int $optionId
97101
* @return $this
98102
*/
@@ -111,7 +115,7 @@ public function updateOptionVote($optionId)
111115
}
112116

113117
/**
114-
* retrieve rating options
118+
* Retrieve rating options
115119
*
116120
* @return array
117121
*/
@@ -142,6 +146,8 @@ public function getEntitySummary($entityPkValue, $onlyForCurrentStore = true)
142146
}
143147

144148
/**
149+
* Get summary of review
150+
*
145151
* @param int $reviewId
146152
* @param bool $onlyForCurrentStore
147153
* @return array

app/code/Magento/Review/Model/Rating/Entity.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
class Entity extends \Magento\Framework\Model\AbstractModel
1717
{
1818
/**
19+
* Initialise the model
20+
*
1921
* @return void
2022
*/
2123
protected function _construct()
@@ -24,6 +26,8 @@ protected function _construct()
2426
}
2527

2628
/**
29+
* Return the ID for the specified code
30+
*
2731
* @param string $entityCode
2832
* @return int
2933
*/

app/code/Magento/Review/Model/Rating/Option.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
class Option extends \Magento\Framework\Model\AbstractModel
2525
{
2626
/**
27+
* Initialise the model
28+
*
2729
* @return void
2830
*/
2931
protected function _construct()
@@ -32,6 +34,8 @@ protected function _construct()
3234
}
3335

3436
/**
37+
* Add a vote
38+
*
3539
* @return $this
3640
*/
3741
public function addVote()
@@ -41,6 +45,8 @@ public function addVote()
4145
}
4246

4347
/**
48+
* Set the identifier
49+
*
4450
* @param mixed $id
4551
* @return $this
4652
*/

app/code/Magento/Review/Model/ResourceModel/Rating/Collection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ protected function _addStoreData()
311311
if (is_array($data) && count($data) > 0) {
312312
foreach ($data as $row) {
313313
$item = $this->getItemById($row['rating_id']);
314-
$item->setStores(array_merge($item->getStores(), [$row['store_id']]));
314+
$stores = $item->getStores();
315+
$stores[] = $row['store_id'];
316+
$item->setStores(array_unique($stores));
315317
}
316318
}
317319
return $this;

0 commit comments

Comments
 (0)