Skip to content

Commit

Permalink
Fixed the phpdocs issues for failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard13 committed Sep 26, 2018
1 parent deebbc0 commit ae2917c
Showing 1 changed file with 44 additions and 28 deletions.
72 changes: 44 additions & 28 deletions app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,13 @@ protected function _getResource()
return parent::_getResource();
}

//@codeCoverageIgnoreStart
/**
* Get a list of custom attribute codes that belongs to product attribute set. If attribute set not specified for
* product will return all product attribute codes
*
* @return string[]
* //@codeCoverageIgnoreEnd
*/
protected function getCustomAttributesCodes()
{
Expand Down Expand Up @@ -584,11 +586,12 @@ public function getPrice()
}

/**
* @codeCoverageIgnoreStart
* Get visibility status
*
* @see \Magento\Catalog\Model\Product\Visibility
*
* @return int
* @codeCoverageIgnoreStart
*/
public function getVisibility()
{
Expand Down Expand Up @@ -824,10 +827,9 @@ public function getStoreIds()
}

/**
* Retrieve product attributes
* if $groupId is null - retrieve all product attributes
* Retrieve product attributes. If $groupId is null - retrieve all product attributes
*
* @param int $groupId Retrieve attributes of the specified group
* @param int|null $groupId Retrieve attributes of the specified group
* @param bool $skipSuper Not used
* @return \Magento\Eav\Model\Entity\Attribute\AbstractAttribute[]
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
Expand Down Expand Up @@ -918,10 +920,9 @@ public function beforeSave()
}

/**
* Check/set if options can be affected when saving product
* If value specified, it will be set.
* Check/set if options can be affected when saving product. If value specified, it will be set.
*
* @param bool $value
* @param bool|null $value
* @return bool
*/
public function canAffectOptions($value = null)
Expand Down Expand Up @@ -1038,10 +1039,10 @@ public function reindex()
}

/**
* Clear cache related with product and protect delete from not admin
* Register indexing event before delete product
* Clear cache related with product and protect delete from not admin. Register indexing event before delete product
*
* @return \Magento\Catalog\Model\Product
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function beforeDelete()
{
Expand Down Expand Up @@ -1548,12 +1549,13 @@ public function hasGalleryAttribute()
/**
* Add image to media gallery
*
* @param string $file file path of image in file system
* @param string|array $mediaAttribute code of attribute with type 'media_image',
* leave blank if image should be only in gallery
* @param boolean $move if true, it will move source file
* @param boolean $exclude mark image as disabled in product page view
* @return \Magento\Catalog\Model\Product
* @param string $file File path of image in file system
* @param null|string|array $mediaAttribute Code of attribute with type 'media_image'
* Leave blank if image should be only in gallery
* @param bool $move If true, it will move source file
* @param bool $exclude Mark image as disabled in product page view
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function addImageToMediaGallery($file, $mediaAttribute = null, $move = false, $exclude = true)
{
Expand Down Expand Up @@ -1714,7 +1716,6 @@ public function getIsSalable()

/**
* Check is a virtual product
* Data helper wrapper
*
* @return bool
*/
Expand Down Expand Up @@ -1806,9 +1807,9 @@ public function formatUrlKey($str)
/**
* Save current attribute with code $code and assign new value
*
* @param string $code Attribute code
* @param mixed $value New attribute value
* @param int $store Store ID
* @param string $code Attribute code
* @param mixed $value New attribute value
* @param int $store Store ID
* @return void
*/
public function addAttributeUpdate($code, $value, $store)
Expand Down Expand Up @@ -1878,6 +1879,7 @@ public function getRequestPath()

/**
* Custom function for other modules
*
* @return string
*/
public function getGiftMessageAvailable()
Expand Down Expand Up @@ -1996,6 +1998,8 @@ public function getOptions()
}

/**
* Set Options
*
* @param \Magento\Catalog\Api\Data\ProductCustomOptionInterface[] $options
* @return $this
*/
Expand All @@ -2019,10 +2023,10 @@ public function getIsVirtual()
/**
* Add custom option information to product
*
* @param string $code Option code
* @param mixed $value Value of the option
* @param int|Product $product Product ID
* @return $this
* @param string $code Option code
* @param mixed $value Value of the option
* @param int|Product|null $product Product ID
* @return $this
*/
public function addCustomOption($code, $value, $product = null)
{
Expand Down Expand Up @@ -2215,8 +2219,7 @@ public function getPreconfiguredValues()
}

/**
* Prepare product custom options.
* To be sure that all product custom options does not has ID and has product instance
* Prepare product custom options.To be sure that all product custom options does not has ID and has product instance
*
* @return \Magento\Catalog\Model\Product
*/
Expand Down Expand Up @@ -2550,7 +2553,7 @@ public function setTypeId($typeId)
}

/**
* {@inheritdoc}
* Get Extension Attributes
*
* @return \Magento\Catalog\Api\Data\ProductExtensionInterface
*/
Expand All @@ -2560,7 +2563,7 @@ public function getExtensionAttributes()
}

/**
* {@inheritdoc}
* Set Extension Attributes
*
* @param \Magento\Catalog\Api\Data\ProductExtensionInterface $extensionAttributes
* @return $this
Expand All @@ -2573,8 +2576,11 @@ public function setExtensionAttributes(\Magento\Catalog\Api\Data\ProductExtensio
//@codeCoverageIgnoreEnd

/**
* Convert Image to ProductAttributeMediaGalleryEntryInterface
*
* @param array $mediaGallery
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]
* @throws \Magento\Framework\Exception\LocalizedException
*/
protected function convertToMediaGalleryInterface(array $mediaGallery)
{
Expand All @@ -2590,7 +2596,10 @@ protected function convertToMediaGalleryInterface(array $mediaGallery)
}

/**
* Get Media Gallery
*
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]|null
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getMediaGalleryEntries()
{
Expand All @@ -2604,8 +2613,11 @@ public function getMediaGalleryEntries()
}

/**
* Set Media Gallery
*
* @param ProductAttributeMediaGalleryEntryInterface[] $mediaGalleryEntries
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function setMediaGalleryEntries(array $mediaGalleryEntries = null)
{
Expand Down Expand Up @@ -2646,6 +2658,8 @@ public function setId($value)
}

/**
* Get Product Link Repository
*
* @return ProductLinkRepositoryInterface
*/
private function getLinkRepository()
Expand All @@ -2658,6 +2672,8 @@ private function getLinkRepository()
}

/**
* Get Media Gallery Processor
*
* @return Product\Gallery\Processor
*/
private function getMediaGalleryProcessor()
Expand Down

0 comments on commit ae2917c

Please sign in to comment.