Skip to content
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

Small PHPDocs fixes [Catalog module] #20338

Merged
merged 4 commits into from Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function delete(\Magento\Catalog\Api\Data\CategoryProductLinkInterface $p
/**
* Remove the product assignment from the category by category id and sku
*
* @param string $categoryId
* @param int $categoryId
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see app/code/Magento/Catalog/Model/CategoryLinkManagement.php:88

* @param string $sku
* @return bool will returned True if products successfully deleted
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* Price interface.
*
* @api
* @since 101.1.0
*/
Expand All @@ -23,6 +24,7 @@ public function getFinalPrice();

/**
* Set the final price: usually it calculated as minimal price of the product
*
* Can be different depends on type of product
*
* @param float $finalPrice
Expand All @@ -33,6 +35,7 @@ public function setFinalPrice($finalPrice);

/**
* Retrieve max price of a product
*
* E.g. for product with custom options is price with the most expensive custom option
*
* @return float
Expand All @@ -51,6 +54,7 @@ public function setMaxPrice($maxPrice);

/**
* Set max regular price
*
* Max regular price is the same, as maximum price, except of excluding calculating special price and catalog rules
* in it
*
Expand Down Expand Up @@ -105,6 +109,8 @@ public function setSpecialPrice($specialPrice);
public function getSpecialPrice();

/**
* Retrieve minimal price
*
* @return float
* @since 101.1.0
*/
Expand All @@ -129,6 +135,7 @@ public function getRegularPrice();

/**
* Regular price - is price of product without discounts and special price with taxes and fixed product tax
*
* Usually this price is corresponding to price in admin panel of product
*
* @param float $regularPrice
Expand All @@ -148,7 +155,7 @@ public function getFormattedPrices();
/**
* Set dto with formatted prices
*
* @param string[] $formattedPriceInfo
* @param FormattedPriceInfoInterface $formattedPriceInfo
* @return void
* @since 101.1.0
*/
Expand Down
9 changes: 7 additions & 2 deletions app/code/Magento/Catalog/Api/Data/ProductRenderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getAddToCartButton();
/**
* Set information needed for render "Add To Cart" button on front
*
* @param \Magento\Catalog\Api\Data\ProductRender\ButtonInterface $addToCartData
* @param ButtonInterface $cartAddToCartButton
* @return void
* @since 101.1.0
*/
Expand All @@ -47,14 +47,15 @@ public function getAddToCompareButton();
/**
* Set information needed for render "Add To Compare" button on front
*
* @param ButtonInterface $compareUrlData
* @param ButtonInterface $compareButton
* @return string
* @since 101.1.0
*/
public function setAddToCompareButton(ButtonInterface $compareButton);

/**
* Provide information needed for render prices and adjustments for different product types on front
*
* Prices are represented in raw format and in current currency
*
* @return \Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface
Expand All @@ -73,6 +74,7 @@ public function setPriceInfo(PriceInfoInterface $priceInfo);

/**
* Provide enough information, that needed to render image on front
*
* Images can be separated by image codes
*
* @return \Magento\Catalog\Api\Data\ProductRender\ImageInterface[]
Expand Down Expand Up @@ -167,6 +169,7 @@ public function getIsSalable();

/**
* Set information about product saleability (Stock, other conditions)
*
* Is used to provide information to frontend JS renders
* You can add plugin, in order to hide product on product page or product list on front
*
Expand All @@ -178,6 +181,7 @@ public function setIsSalable($isSalable);

/**
* Provide information about current store id or requested store id
*
* Product should be assigned to provided store id
* This setting affect store scope attributes
*
Expand All @@ -197,6 +201,7 @@ public function setStoreId($storeId);

/**
* Provide current or desired currency code to product
*
* This setting affect formatted prices*
*
* @return string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* See COPYING.txt for license details.
*/

namespace Magento\Catalog\Block\Adminhtml\Product\Frontend\Product;

use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Fieldset config form element renderer
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Product\Frontend\Product;

use Magento\Framework\Data\Form\Element\AbstractElement;

class Watermark extends \Magento\Backend\Block\AbstractBlock implements
\Magento\Framework\Data\Form\Element\Renderer\RendererInterface
{
Expand Down Expand Up @@ -60,6 +60,8 @@ public function __construct(
}

/**
* Render form element as HTML
*
* @param AbstractElement $element
* @return string
*/
Expand Down Expand Up @@ -124,13 +126,14 @@ public function render(AbstractElement $element)
}

/**
* Get header html for render
*
* @param AbstractElement $element
* @return string
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
protected function _getHeaderHtml($element)
{
$id = $element->getHtmlId();
$default = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');

$html = '<h4 class="icon-head head-edit-form">' . $element->getLegend() . '</h4>';
Expand All @@ -148,6 +151,8 @@ protected function _getHeaderHtml($element)
}

/**
* Get footer html for render
*
* @param AbstractElement $element
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;

/**
* Move category admin controller
*/
class Move extends \Magento\Catalog\Controller\Adminhtml\Category implements HttpPostActionInterface
{
/**
Expand Down Expand Up @@ -46,7 +49,7 @@ public function __construct(
/**
* Move category action
*
* @return \Magento\Framework\Controller\Result\Raw
* @return \Magento\Framework\Controller\Result\Json
*/
public function execute()
{
Expand Down
9 changes: 7 additions & 2 deletions app/code/Magento/Catalog/Controller/Index/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
*/
namespace Magento\Catalog\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
use Magento\Framework\App\Action\HttpGetActionInterface;

/**
* Catalog index page controller.
*/
class Index extends \Magento\Framework\App\Action\Action implements HttpGetActionInterface
{
/**
* Index action
*
* @return $this
* @return \Magento\Framework\Controller\Result\Redirect
*/
public function execute()
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Catalog/Helper/Product/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Configuration extends AbstractHelper implements ConfigurationInterface
* @param \Magento\Framework\Filter\FilterManager $filter
* @param \Magento\Framework\Stdlib\StringUtils $string
* @param Json $serializer
* @param Escaper $escaper
*/
public function __construct(
\Magento\Framework\App\Helper\Context $context,
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Catalog/Helper/Product/ProductList.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ProductList

/**
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Magento\Framework\Registry $coreRegistry
*/
public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Catalog/Helper/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

/**
* Catalog category helper
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class View extends \Magento\Framework\App\Helper\AbstractHelper
{
Expand Down Expand Up @@ -105,7 +107,7 @@ public function __construct(
*
* @param \Magento\Framework\View\Result\Page $resultPage
* @param \Magento\Catalog\Model\Product $product
* @return \Magento\Framework\View\Result\Page
* @return $this
*/
private function preparePageMetadata(ResultPage $resultPage, $product)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Magento\Store\Model\StoreManagerInterface;

/**
* Category rows indexer.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractAction
Expand Down Expand Up @@ -213,6 +215,7 @@ protected function isRangingNeeded()
/**
* Returns a list of category ids which are assigned to product ids in the index
*
* @param array $productIds
* @return \Magento\Framework\Indexer\CacheContext
*/
private function getCategoryIdsFromIndex(array $productIds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(
* @param int $storeId
* @param int $productId
* @param string $valueFieldSuffix
* @return \Magento\Catalog\Model\Indexer\Product\Flat
* @return $this
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.NPathComplexity)
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/Layer/Filter/Decimal.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Decimal extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Catalog\Model\Layer $layer
* @param \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder
* @param \Magento\Catalog\Model\ResourceModel\Layer\Filter\DecimalFactory $filterDecimalFactory
* @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
* @param \Magento\Catalog\Model\Layer\Filter\DataProvider\DecimalFactory $dataProviderFactory
* @param array $data
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*/
namespace Magento\Catalog\Model\Plugin\ProductRepository;

/**
* Transaction wrapper for product repository CRUD.
*/
class TransactionWrapper
{
/**
Expand All @@ -24,8 +27,10 @@ public function __construct(
}

/**
* Transaction wrapper for save action.
*
* @param \Magento\Catalog\Api\ProductRepositoryInterface $subject
* @param callable $proceed
* @param \Closure $proceed
* @param \Magento\Catalog\Api\Data\ProductInterface $product
* @param bool $saveOptions
* @return \Magento\Catalog\Api\Data\ProductInterface
Expand All @@ -51,8 +56,10 @@ public function aroundSave(
}

/**
* Transaction wrapper for delete action.
*
* @param \Magento\Catalog\Api\ProductRepositoryInterface $subject
* @param callable $proceed
* @param \Closure $proceed
* @param \Magento\Catalog\Api\Data\ProductInterface $product
* @return bool
* @throws \Exception
Expand All @@ -76,8 +83,10 @@ public function aroundDelete(
}

/**
* Transaction wrapper for delete by id action.
*
* @param \Magento\Catalog\Api\ProductRepositoryInterface $subject
* @param callable $proceed
* @param \Closure $proceed
* @param string $productSku
* @return bool
* @throws \Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Catalog product option date type
*
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class Date extends \Magento\Catalog\Model\Product\Option\Type\DefaultType
{
Expand Down Expand Up @@ -147,7 +148,6 @@ public function validateUserValue($values)
public function prepareForCart()
{
if ($this->getIsValid() && $this->getUserValue() !== null) {
$option = $this->getOption();
$value = $this->getUserValue();

if (isset($value['date_internal']) && $value['date_internal'] != '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Magento\Catalog\Model\ResourceModel\Product\Website\Link as ProductWebsiteLink;
use Magento\Framework\EntityManager\Operation\ExtensionInterface;

/**
* Add websites ids to product extension attributes.
*/
class ReadHandler implements ExtensionInterface
{
/**
Expand All @@ -18,7 +21,7 @@ class ReadHandler implements ExtensionInterface

/**
* ReadHandler constructor.
* @param ProductWebsiteLink $resourceModel
* @param ProductWebsiteLink $productWebsiteLink
*/
public function __construct(
ProductWebsiteLink $productWebsiteLink
Expand All @@ -27,6 +30,8 @@ public function __construct(
}

/**
* Add website ids to product extension attributes, if no set.
*
* @param ProductInterface $product
* @param array $arguments
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/ProductRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function getExtensionAttributes()
* Set an extension attributes object.
*
* @param \Magento\Catalog\Api\Data\ProductRenderExtensionInterface $extensionAttributes
* @return $this
* @return void
*/
public function setExtensionAttributes(
\Magento\Catalog\Api\Data\ProductRenderExtensionInterface $extensionAttributes
Expand Down
Loading