diff --git a/app/code/Magento/Review/Block/Adminhtml/Add.php b/app/code/Magento/Review/Block/Adminhtml/Add.php index 5f739b2595418..fca6419ca6037 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Add.php +++ b/app/code/Magento/Review/Block/Adminhtml/Add.php @@ -8,8 +8,6 @@ /** * Adminhtml add Review main block - * - * @author Magento Core Team */ class Add extends \Magento\Backend\Block\Widget\Form\Container { diff --git a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php index efffa7a02678a..452f716800296 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php @@ -10,14 +10,10 @@ /** * Adminhtml add product review form - * - * @author Magento Core Team */ class Form extends \Magento\Backend\Block\Widget\Form\Generic { /** - * Review data - * * @var \Magento\Review\Helper\Data */ protected $_reviewData = null; diff --git a/app/code/Magento/Review/Block/Adminhtml/Grid/Filter/Type.php b/app/code/Magento/Review/Block/Adminhtml/Grid/Filter/Type.php index b042def8dac77..76158272baeeb 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Grid/Filter/Type.php +++ b/app/code/Magento/Review/Block/Adminhtml/Grid/Filter/Type.php @@ -7,8 +7,6 @@ /** * Adminhtml review grid filter by type - * - * @author Magento Core Team */ class Type extends \Magento\Backend\Block\Widget\Grid\Column\Filter\Select { diff --git a/app/code/Magento/Review/Block/Adminhtml/Grid/Renderer/Type.php b/app/code/Magento/Review/Block/Adminhtml/Grid/Renderer/Type.php index 83108ad6cb514..535dea3da46b7 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Grid/Renderer/Type.php +++ b/app/code/Magento/Review/Block/Adminhtml/Grid/Renderer/Type.php @@ -7,8 +7,6 @@ /** * Adminhtml review grid item renderer for item type - * - * @author Magento Core Team */ class Type extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer { diff --git a/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php index d3bbdf9a7eb40..282df148991a6 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php @@ -8,7 +8,6 @@ /** * Adminhtml product grid block * - * @author Magento Core Team * @SuppressWarnings(PHPMD.DepthOfInheritance) */ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating.php b/app/code/Magento/Review/Block/Adminhtml/Rating.php index a9b6c89176283..af5e2cfe088da 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating.php @@ -9,12 +9,13 @@ * Ratings grid * * @api - * @author Magento Core Team * @since 100.0.2 */ class Rating extends \Magento\Backend\Block\Widget\Grid\Container { /** + * Initialise the block + * * @return void */ protected function _construct() diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Form.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Form.php index 61bb2ce2e903a..3051039abae23 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Form.php @@ -7,12 +7,12 @@ /** * Rating edit form block - * - * @author Magento Core Team */ class Form extends \Magento\Backend\Block\Widget\Form\Generic { /** + * Prepare the form + * * @return $this */ protected function _prepareForm() diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tabs.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tabs.php index 86c7ee6a24597..6d894a0b44805 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tabs.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tabs.php @@ -7,12 +7,12 @@ /** * Admin rating left menu - * - * @author Magento Core Team */ class Tabs extends \Magento\Backend\Block\Widget\Tabs { /** + * Initialise the block + * * @return void */ protected function _construct() @@ -24,6 +24,8 @@ protected function _construct() } /** + * Add rating information tab + * * @return $this */ protected function _beforeToHtml() diff --git a/app/code/Magento/Review/Block/Customer/View.php b/app/code/Magento/Review/Block/Customer/View.php index bb322f17b6ce9..803b073040620 100644 --- a/app/code/Magento/Review/Block/Customer/View.php +++ b/app/code/Magento/Review/Block/Customer/View.php @@ -14,7 +14,6 @@ * Customer Review detailed view block * * @api - * @author Magento Core Team * @since 100.0.2 */ class View extends \Magento\Catalog\Block\Product\AbstractProduct @@ -162,6 +161,7 @@ public function getRating() * Get rating summary * * @deprecated 100.3.3 + * @see f72f74d3 * @return array */ public function getRatingSummary() @@ -183,11 +183,14 @@ public function getTotalReviews() { if (!$this->getTotalReviewsCache()) { $this->setTotalReviewsCache( - $this->_reviewFactory->create()->getTotalReviews($this->getProductData()->getId()), - false, - $this->_storeManager->getStore()->getId() + $this->_reviewFactory->create()->getTotalReviews( + $this->getProductData()->getId(), + false, + $this->_storeManager->getStore()->getId() + ) ); } + return $this->getTotalReviewsCache(); } diff --git a/app/code/Magento/Review/Block/Form.php b/app/code/Magento/Review/Block/Form.php index c6dfad8265ac7..35a47aca8715a 100644 --- a/app/code/Magento/Review/Block/Form.php +++ b/app/code/Magento/Review/Block/Form.php @@ -14,15 +14,12 @@ * Review form block * * @api - * @author Magento Core Team * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @since 100.0.2 */ class Form extends \Magento\Framework\View\Element\Template { /** - * Review data - * * @var \Magento\Review\Helper\Data */ protected $_reviewData = null; @@ -74,8 +71,6 @@ class Form extends \Magento\Framework\View\Element\Template private $serializer; /** - * Form constructor. - * * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Url\EncoderInterface $urlEncoder * @param \Magento\Review\Helper\Data $reviewData @@ -143,6 +138,8 @@ protected function _construct() } /** + * Return JavaScript layout object + * * @return string */ public function getJsLayout() diff --git a/app/code/Magento/Review/Block/Form/Configure.php b/app/code/Magento/Review/Block/Form/Configure.php index e76fa8bd1c6d5..cedb01e063e29 100644 --- a/app/code/Magento/Review/Block/Form/Configure.php +++ b/app/code/Magento/Review/Block/Form/Configure.php @@ -9,7 +9,6 @@ * Review form block * * @api - * @author Magento Core Team * @since 100.0.2 */ class Configure extends \Magento\Review\Block\Form diff --git a/app/code/Magento/Review/Block/Product/Review.php b/app/code/Magento/Review/Block/Product/Review.php index 569105f60490a..a8b32212b7aa5 100644 --- a/app/code/Magento/Review/Block/Product/Review.php +++ b/app/code/Magento/Review/Block/Product/Review.php @@ -12,14 +12,11 @@ * Product Review Tab * * @api - * @author Magento Core Team * @since 100.0.2 */ class Review extends Template implements IdentityInterface { /** - * Core registry - * * @var \Magento\Framework\Registry */ protected $_coreRegistry; diff --git a/app/code/Magento/Review/Block/Product/View.php b/app/code/Magento/Review/Block/Product/View.php index c66e3e50b919b..7256c8194626e 100644 --- a/app/code/Magento/Review/Block/Product/View.php +++ b/app/code/Magento/Review/Block/Product/View.php @@ -11,7 +11,6 @@ /** * Product Reviews Page * - * @author Magento Core Team * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class View extends \Magento\Catalog\Block\Product\View diff --git a/app/code/Magento/Review/Block/Rating/Entity/Detailed.php b/app/code/Magento/Review/Block/Rating/Entity/Detailed.php index d496b3955de7b..af03734517285 100644 --- a/app/code/Magento/Review/Block/Rating/Entity/Detailed.php +++ b/app/code/Magento/Review/Block/Rating/Entity/Detailed.php @@ -7,8 +7,6 @@ /** * Entity rating block - * - * @author Magento Core Team */ class Detailed extends \Magento\Framework\View\Element\Template { diff --git a/app/code/Magento/Review/Block/View.php b/app/code/Magento/Review/Block/View.php index bbdd246835f9e..37a61a9032eed 100644 --- a/app/code/Magento/Review/Block/View.php +++ b/app/code/Magento/Review/Block/View.php @@ -9,7 +9,6 @@ * Review detailed view block * * @api - * @author Magento Core Team * @since 100.0.2 */ class View extends \Magento\Catalog\Block\Product\AbstractProduct @@ -121,6 +120,7 @@ public function getRating() * Retrieve rating summary for current product * * @deprecated 100.3.3 + * @see f72f74d3 * @return string */ public function getRatingSummary() diff --git a/app/code/Magento/Review/Model/Rating.php b/app/code/Magento/Review/Model/Rating.php index c8506926f5160..093a73ae86442 100644 --- a/app/code/Magento/Review/Model/Rating.php +++ b/app/code/Magento/Review/Model/Rating.php @@ -17,7 +17,6 @@ * @method \Magento\Review\Model\Rating setStores(array $value) * @method string getRatingCode() * - * @author Magento Core Team * @since 100.0.2 */ class Rating extends \Magento\Framework\Model\AbstractModel implements IdentityInterface @@ -25,11 +24,11 @@ class Rating extends \Magento\Framework\Model\AbstractModel implements IdentityI /** * rating entity codes */ - const ENTITY_PRODUCT_CODE = 'product'; + public const ENTITY_PRODUCT_CODE = 'product'; - const ENTITY_PRODUCT_REVIEW_CODE = 'product_review'; + public const ENTITY_PRODUCT_REVIEW_CODE = 'product_review'; - const ENTITY_REVIEW_CODE = 'review'; + public const ENTITY_REVIEW_CODE = 'review'; /** * @var \Magento\Review\Model\Rating\OptionFactory @@ -75,6 +74,8 @@ protected function _construct() } /** + * Add a vote to an option + * * @param int $optionId * @param int $entityPkValue * @return $this @@ -94,6 +95,8 @@ public function addOptionVote($optionId, $entityPkValue) } /** + * Update a vote for an option + * * @param int $optionId * @return $this */ @@ -112,7 +115,7 @@ public function updateOptionVote($optionId) } /** - * retrieve rating options + * Retrieve rating options * * @return array */ @@ -143,6 +146,8 @@ public function getEntitySummary($entityPkValue, $onlyForCurrentStore = true) } /** + * Get summary of review + * * @param int $reviewId * @param bool $onlyForCurrentStore * @return array diff --git a/app/code/Magento/Review/Model/Rating/Entity.php b/app/code/Magento/Review/Model/Rating/Entity.php index cc2d5ab852518..d69252806ff7a 100644 --- a/app/code/Magento/Review/Model/Rating/Entity.php +++ b/app/code/Magento/Review/Model/Rating/Entity.php @@ -11,12 +11,13 @@ * @method string getEntityCode() * @method \Magento\Review\Model\Rating\Entity setEntityCode(string $value) * - * @author Magento Core Team * @codeCoverageIgnore */ class Entity extends \Magento\Framework\Model\AbstractModel { /** + * Initialise the model + * * @return void */ protected function _construct() @@ -25,6 +26,8 @@ protected function _construct() } /** + * Return the ID for the specified code + * * @param string $entityCode * @return int */ diff --git a/app/code/Magento/Review/Model/Rating/Option.php b/app/code/Magento/Review/Model/Rating/Option.php index 2f5ece53d1bb1..8530e43270925 100644 --- a/app/code/Magento/Review/Model/Rating/Option.php +++ b/app/code/Magento/Review/Model/Rating/Option.php @@ -18,13 +18,14 @@ * @method int getPosition() * @method \Magento\Review\Model\Rating\Option setPosition(int $value) * - * @author Magento Core Team * @codeCoverageIgnore * @since 100.0.2 */ class Option extends \Magento\Framework\Model\AbstractModel { /** + * Initialise the model + * * @return void */ protected function _construct() @@ -33,6 +34,8 @@ protected function _construct() } /** + * Add a vote + * * @return $this */ public function addVote() @@ -42,6 +45,8 @@ public function addVote() } /** + * Set the identifier + * * @param mixed $id * @return $this */ diff --git a/app/code/Magento/Review/Model/Rating/Option/Vote.php b/app/code/Magento/Review/Model/Rating/Option/Vote.php index 1cf720092fb3e..26f5fd1fdcb0b 100644 --- a/app/code/Magento/Review/Model/Rating/Option/Vote.php +++ b/app/code/Magento/Review/Model/Rating/Option/Vote.php @@ -9,14 +9,14 @@ * Rating vote model * * @api - * - * @author Magento Core Team * @codeCoverageIgnore * @since 100.0.2 */ class Vote extends \Magento\Framework\Model\AbstractModel { /** + * Initialise the class + * * @return void */ protected function _construct() diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 81f732f1b9ea1..edaffaf498420 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -12,18 +12,14 @@ * Rating resource model * * @api - * - * @author Magento Core Team * @since 100.0.2 * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { - const RATING_STATUS_APPROVED = 'Approved'; + public const RATING_STATUS_APPROVED = 'Approved'; /** - * Store manager - * * @var \Magento\Store\Model\StoreManagerInterface */ protected $_storeManager; diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Rating/Collection.php index 0dcb9da6a8c75..f18c5f0b44a22 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating/Collection.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating/Collection.php @@ -9,8 +9,6 @@ * Rating collection resource model * * @api - * - * @author Magento Core Team * @since 100.0.2 */ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection @@ -26,7 +24,6 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\Ab protected $_ratingCollectionF; /** - * Add store data flag * @var bool */ protected $_addStoreDataFlag = false; @@ -130,7 +127,7 @@ public function setStoreFilter($storeId) if (!is_array($storeId)) { $storeId = [$storeId === null ? -1 : $storeId]; } - if (empty($storeId)) { + if ($storeId == 0) { return $this; } if (!$this->_isStoreJoined) { @@ -314,7 +311,9 @@ protected function _addStoreData() if (is_array($data) && count($data) > 0) { foreach ($data as $row) { $item = $this->getItemById($row['rating_id']); - $item->setStores(array_merge($item->getStores(), [$row['store_id']])); + $stores = $item->getStores(); + $stores[] = $row['store_id']; + $item->setStores(array_unique($stores)); } } return $this; diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating/Entity.php b/app/code/Magento/Review/Model/ResourceModel/Rating/Entity.php index f19a2bb328efa..b60412f67bfab 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating/Entity.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating/Entity.php @@ -7,8 +7,6 @@ /** * Rating entity resource - * - * @author Magento Core Team */ class Entity extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating/Grid/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Rating/Grid/Collection.php index 3a6e880bf6f28..3a3fa215ce4c1 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating/Grid/Collection.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating/Grid/Collection.php @@ -7,14 +7,10 @@ /** * Rating grid collection - * - * @author Magento Core Team */ class Collection extends \Magento\Review\Model\ResourceModel\Rating\Collection { /** - * Core registry - * * @var \Magento\Framework\Registry */ protected $_coreRegistry = null; diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Collection.php index 394eb5c3e077a..346d8ded6ab5d 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Collection.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Collection.php @@ -7,8 +7,6 @@ /** * Rating option collection - * - * @author Magento Core Team */ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection { diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Vote.php b/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Vote.php index ed20396bb382d..e90182461b9ee 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Vote.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Vote.php @@ -7,8 +7,6 @@ /** * Rating vote resource model - * - * @author Magento Core Team */ class Vote extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Vote/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Vote/Collection.php index 134fa7771633f..34a4e734ef801 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Vote/Collection.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating/Option/Vote/Collection.php @@ -9,7 +9,6 @@ * Rating votes collection * * @api - * @author Magento Core Team * @since 100.0.2 */ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection diff --git a/app/code/Magento/Review/Model/ResourceModel/Review/Status.php b/app/code/Magento/Review/Model/ResourceModel/Review/Status.php index 0c865e0ab8fc4..4112fdb7cee22 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Review/Status.php +++ b/app/code/Magento/Review/Model/ResourceModel/Review/Status.php @@ -7,8 +7,6 @@ /** * Review status resource model - * - * @author Magento Core Team */ class Status extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { diff --git a/app/code/Magento/Review/Model/ResourceModel/Review/Status/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Review/Status/Collection.php index 05a3ae4728f7c..44a0dcffa7bec 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Review/Status/Collection.php +++ b/app/code/Magento/Review/Model/ResourceModel/Review/Status/Collection.php @@ -6,16 +6,12 @@ /** * Review statuses collection - * - * @author Magento Core Team */ namespace Magento\Review\Model\ResourceModel\Review\Status; class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection { /** - * Review status table - * * @var string */ protected $_reviewStatusTable; diff --git a/app/code/Magento/Review/Model/ResourceModel/Review/Summary.php b/app/code/Magento/Review/Model/ResourceModel/Review/Summary.php index e7597f7c313e4..19e0d6ce66d01 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Review/Summary.php +++ b/app/code/Magento/Review/Model/ResourceModel/Review/Summary.php @@ -10,8 +10,6 @@ /** * Review summary resource model - * - * @author Magento Core Team */ class Summary extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { diff --git a/app/code/Magento/Review/Model/ResourceModel/Review/Summary/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Review/Summary/Collection.php index 04f6127e6fe00..14a9ebd96792c 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Review/Summary/Collection.php +++ b/app/code/Magento/Review/Model/ResourceModel/Review/Summary/Collection.php @@ -7,8 +7,6 @@ /** * Review summery collection - * - * @author Magento Core Team */ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection { diff --git a/app/code/Magento/Review/Model/Review/Status.php b/app/code/Magento/Review/Model/Review/Status.php index 1ea151cf23173..5cc3dd142a7d7 100644 --- a/app/code/Magento/Review/Model/Review/Status.php +++ b/app/code/Magento/Review/Model/Review/Status.php @@ -7,7 +7,6 @@ /** * Review status * - * @author Magento Core Team * @codeCoverageIgnore */ namespace Magento\Review\Model\Review;