Skip to content

Add missing phpdocs #31744

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

Open
wants to merge 13 commits into
base: 2.4-develop
Choose a base branch
from
12 changes: 6 additions & 6 deletions app/code/Magento/Customer/Model/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ public function getPrimaryAddress($attributeCode)
/**
* Get customer default billing address
*
* @return Address
* @return Address|false
*/
public function getPrimaryBillingAddress()
{
Expand All @@ -682,7 +682,7 @@ public function getPrimaryBillingAddress()
/**
* Get customer default billing address
*
* @return Address
* @return Address|false
*/
public function getDefaultBillingAddress()
{
Expand All @@ -692,7 +692,7 @@ public function getDefaultBillingAddress()
/**
* Get default customer shipping address
*
* @return Address
* @return Address|false
*/
public function getPrimaryShippingAddress()
{
Expand All @@ -702,7 +702,7 @@ public function getPrimaryShippingAddress()
/**
* Get default customer shipping address
*
* @return Address
* @return Address|false
*/
public function getDefaultShippingAddress()
{
Expand Down Expand Up @@ -773,7 +773,7 @@ public function getAdditionalAddresses()
* Check if address is primary
*
* @param Address $address
* @return boolean
* @return bool
*/
public function isAddressPrimary(Address $address)
{
Expand Down Expand Up @@ -1284,7 +1284,7 @@ public function changeResetPasswordLinkToken($passwordLinkToken)
/**
* Check if current reset password link token is expired
*
* @return boolean
* @return bool
*/
public function isResetPasswordLinkTokenExpired()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ public function getMainTable()
/**
* Wrapper for compatibility with \Magento\Framework\Data\Collection\AbstractDb
*
* @param string $field
* @param array|string|integer|\Magento\Framework\App\Config\Element $field
* @param string $alias
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @return $this|\Magento\Framework\Data\Collection\AbstractDb
Expand Down
29 changes: 15 additions & 14 deletions app/code/Magento/Quote/Model/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Magento\Quote\Api\Data\PaymentInterface;
use Magento\Quote\Model\Quote\Address;
use Magento\Quote\Model\Quote\Address\Total as AddressTotal;
use Magento\Quote\Model\Quote\Item;
use Magento\Sales\Model\Status;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\ObjectManager;
Expand Down Expand Up @@ -1422,13 +1423,13 @@ public function getItemsCollection($useCache = true)
/**
* Retrieve quote items array
*
* @return array
* @return Item[]
*/
public function getAllItems()
{
$items = [];
foreach ($this->getItemsCollection() as $item) {
/** @var \Magento\Quote\Model\Quote\Item $item */
/** @var Item $item */
if (!$item->isDeleted()) {
$items[] = $item;
}
Expand All @@ -1439,7 +1440,7 @@ public function getAllItems()
/**
* Get array of all items what can be display directly
*
* @return \Magento\Quote\Model\Quote\Item[]
* @return Item[]
*/
public function getAllVisibleItems()
{
Expand Down Expand Up @@ -1502,7 +1503,7 @@ public function hasProductId($productId)
* Retrieve item model object by item identifier
*
* @param int $itemId
* @return \Magento\Quote\Model\Quote\Item|false
* @return Item|false
*/
public function getItemById($itemId)
{
Expand All @@ -1518,10 +1519,10 @@ public function getItemById($itemId)
/**
* Delete quote item. If it does not have identifier then it will be only removed from collection
*
* @param \Magento\Quote\Model\Quote\Item $item
* @param Item $item
* @return $this
*/
public function deleteItem(\Magento\Quote\Model\Quote\Item $item)
public function deleteItem(Item $item)
{
if ($item->getId()) {
$this->removeItem($item->getId());
Expand Down Expand Up @@ -1599,11 +1600,11 @@ public function removeAllItems()
/**
* Adding new item to quote
*
* @param \Magento\Quote\Model\Quote\Item $item
* @param Item $item
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function addItem(\Magento\Quote\Model\Quote\Item $item)
public function addItem(Item $item)
{
$item->setQuote($this);
if (!$item->getId()) {
Expand All @@ -1619,7 +1620,7 @@ public function addItem(\Magento\Quote\Model\Quote\Item $item)
* @param mixed $product
* @param null|float|\Magento\Framework\DataObject $request
* @param null|string $processMode
* @return \Magento\Quote\Model\Quote\Item|string
* @return Item|string
* @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
Expand Down Expand Up @@ -1720,7 +1721,7 @@ public function addProduct(
*
* @param \Magento\Catalog\Model\Product $product
* @param int $qty
* @return \Magento\Quote\Model\Quote\Item
* @return Item
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _addCatalogProduct(\Magento\Catalog\Model\Product $product, $qty = 1)
Expand Down Expand Up @@ -1772,7 +1773,7 @@ protected function _addCatalogProduct(\Magento\Catalog\Model\Product $product, $
* @param int $itemId
* @param \Magento\Framework\DataObject $buyRequest
* @param null|array|\Magento\Framework\DataObject $params
* @return \Magento\Quote\Model\Quote\Item
* @return Item
* @throws \Magento\Framework\Exception\LocalizedException
*
* @see \Magento\Catalog\Helper\Product::addParamsToBuyRequest()
Expand Down Expand Up @@ -1839,7 +1840,7 @@ public function updateItem($itemId, $buyRequest, $params = null)
* Retrieve quote item by product id
*
* @param \Magento\Catalog\Model\Product $product
* @return \Magento\Quote\Model\Quote\Item|bool
* @return Item|false
*/
public function getItemByProduct($product)
{
Expand Down Expand Up @@ -2316,7 +2317,7 @@ public function validateMinimumAmount($multishipping = false)
? $address->getBaseTaxAmount() + $address->getBaseDiscountTaxCompensationAmount()
: 0;
foreach ($address->getQuote()->getItemsCollection() as $item) {
/** @var \Magento\Quote\Model\Quote\Item $item */
/** @var Item $item */
$amount = $includeDiscount ?
$item->getBaseRowTotal() - $item->getBaseDiscountAmount() + $taxes :
$item->getBaseRowTotal() + $taxes;
Expand Down Expand Up @@ -2353,7 +2354,7 @@ public function isVirtual()
$isVirtual = true;
$countItems = 0;
foreach ($this->getItemsCollection() as $_item) {
/* @var $_item \Magento\Quote\Model\Quote\Item */
/* @var Item $_item */
if ($_item->isDeleted() || $_item->getParentItemId()) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Quote/Model/Quote/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ protected function _addOptionCode($option)
* Get item option by code
*
* @param string $code
* @return \Magento\Quote\Model\Quote\Item\Option || null
* @return \Magento\Quote\Model\Quote\Item\Option|null
*/
public function getOptionByCode($code)
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Quote/Model/Quote/Item/AbstractItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function setParentItem($parentItem)
/**
* Get parent item
*
* @return Item
* @return Item|null
*/
public function getParentItem()
{
Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/Store/Model/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ public function setWebsite(Website $website)
/**
* Retrieve store website
*
* @return Website|bool
* @return Website|false
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function getWebsite()
Expand Down Expand Up @@ -738,7 +738,7 @@ protected function _isCustomEntryPoint()
*
* @param Filesystem $filesystem
* @param bool $secure
* @return string|bool
* @return string|false
*/
protected function _getMediaScriptUrl(Filesystem $filesystem, $secure)
{
Expand Down Expand Up @@ -809,7 +809,7 @@ public function isUrlSecure()
/**
* Check if request was secure
*
* @return boolean
* @return bool
*/
public function isCurrentlySecure()
{
Expand Down Expand Up @@ -1043,7 +1043,7 @@ public function setGroup(Group $group)
/**
* Retrieve group model
*
* @return Group|bool
* @return Group|false
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function getGroup()
Expand Down Expand Up @@ -1157,7 +1157,7 @@ public function getDefaultGroupId()
/**
* Check if store can be deleted
*
* @return boolean
* @return bool
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function isCanDelete()
Expand Down
8 changes: 4 additions & 4 deletions lib/internal/Magento/Framework/Data/Structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function createElement($elementId, array $data)
* Get existing element
*
* @param string $elementId
* @return array|bool
* @return array|false
*/
public function getElement($elementId)
{
Expand Down Expand Up @@ -446,7 +446,7 @@ private function _getRelativeOffset($parentId, $siblingId, $delta)
*
* @param string $parentId
* @param string $alias
* @return string|bool
* @return string|false
*/
public function getChildId($parentId, $alias)
{
Expand All @@ -473,7 +473,7 @@ public function getChildren($parentId)
* Get name of parent element
*
* @param string $childId
* @return string|bool
* @return string|false
*/
public function getParentId($childId)
{
Expand All @@ -485,7 +485,7 @@ public function getParentId($childId)
*
* @param string $parentId
* @param string $childId
* @return string|bool
* @return string|false
*/
public function getChildAlias($parentId, $childId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public function getTable($tableName)
* Get connection by resource name
*
* @param string $resourceName
* @return \Magento\Framework\DB\Adapter\AdapterInterface|false
* @return \Magento\Framework\DB\Adapter\AdapterInterface
*/
protected function _getConnection($resourceName)
{
Expand All @@ -325,7 +325,7 @@ protected function _getConnection($resourceName)
/**
* Get connection
*
* @return \Magento\Framework\DB\Adapter\AdapterInterface|false
* @return \Magento\Framework\DB\Adapter\AdapterInterface
*/
public function getConnection()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface SerializerInterface
* Serialize data into string
*
* @param string|int|float|bool|array|null $data
* @return string|bool
* @return string
* @throws \InvalidArgumentException
* @since 101.0.0
*/
Expand Down
8 changes: 4 additions & 4 deletions lib/internal/Magento/Framework/Stdlib/DateTime/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function calculateOffset($timezone = null)
* Forms GMT date
*
* @param string $format
* @param int|string $input date in current timezone
* @param int|string|\DateTimeInterface|null $input date in current timezone
* @return string
*/
public function gmtDate($format = null, $input = null)
Expand All @@ -74,7 +74,7 @@ public function gmtDate($format = null, $input = null)
* Converts input date into date with timezone offset. Input date must be in GMT timezone.
*
* @param string $format
* @param int|string $input date in GMT timezone
* @param int|string|\DateTimeInterface|null $input date in GMT timezone
* @return string
*/
public function date($format = null, $input = null)
Expand All @@ -89,7 +89,7 @@ public function date($format = null, $input = null)
/**
* Forms GMT timestamp
*
* @param int|string|\DateTimeInterface $input date in current timezone
* @param int|string|\DateTimeInterface|null $input date in current timezone
* @return int
*/
public function gmtTimestamp($input = null)
Expand All @@ -116,7 +116,7 @@ public function gmtTimestamp($input = null)
/**
* Converts input date into timestamp with timezone offset. Input date must be in GMT timezone.
*
* @param int|string $input date in GMT timezone
* @param int|string|\DateTimeInterface|null $input date in GMT timezone
* @return int
*/
public function timestamp($input = null)
Expand Down
8 changes: 4 additions & 4 deletions lib/internal/Magento/Framework/View/Element/AbstractBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ protected function _construct()
/**
* Retrieve parent block
*
* @return \Magento\Framework\View\Element\AbstractBlock|bool
* @return \Magento\Framework\View\Element\AbstractBlock|false
*/
public function getParentBlock()
{
Expand Down Expand Up @@ -489,7 +489,7 @@ public function unsetChildren()
* Retrieve child block by name
*
* @param string $alias
* @return \Magento\Framework\View\Element\AbstractBlock|bool
* @return \Magento\Framework\View\Element\AbstractBlock|false
*/
public function getChildBlock($alias)
{
Expand Down Expand Up @@ -587,7 +587,7 @@ public function getBlockHtml($name)
* @param string|int|null $siblingName
* @param bool $after
* @param string $alias
* @return $this|bool
* @return $this|false
*/
public function insert($element, $siblingName = 0, $after = true, $alias = '')
{
Expand Down Expand Up @@ -1082,7 +1082,7 @@ protected function getCacheTags()
/**
* Get block cache life time
*
* @return int|bool|null
* @return int|null
*/
protected function getCacheLifetime()
{
Expand Down
Loading