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

Some fixes for phpdocs #2588

Merged
merged 4 commits into from
Sep 12, 2022
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
8 changes: 4 additions & 4 deletions app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Mage_Admin_Model_Acl_Assert_Ip implements Zend_Acl_Assert_Interface
* Check whether ip is allowed
*
* @param Mage_Admin_Model_Acl $acl
* @param Mage_Admin_Model_Acl_Role $role
* @param Mage_Admin_Model_Acl_Resource $resource
* @param string $privilege
* @return bool
* @param Mage_Admin_Model_Acl_Role|null $role
* @param Mage_Admin_Model_Acl_Resource|null $resource
* @param string|null $privilege
* @return bool|null
*/
public function assert(
Mage_Admin_Model_Acl $acl,
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Admin/Model/Acl/Assert/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Mage_Admin_Model_Acl_Assert_Time implements Zend_Acl_Assert_Interface
* Assert time
*
* @param Mage_Admin_Model_Acl $acl
* @param Mage_Admin_Model_Acl_Role $role
* @param Mage_Admin_Model_Acl_Resource $resource
* @param string $privilege
* @return bool
* @param Mage_Admin_Model_Acl_Role|null $role
* @param Mage_Admin_Model_Acl_Resource|null $resource
* @param string|null $privilege
* @return bool|null
*/
public function assert(
Mage_Admin_Model_Acl $acl,
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Redirectpolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($parameters = [])
* Redirect to startup page after logging in if request contains any params (except security key)
*
* @param Mage_Admin_Model_User $user
* @param Zend_Controller_Request_Http $request
* @param Zend_Controller_Request_Http|null $request
* @param string|null $alternativeUrl
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function getProduct()
/**
* Set product object
*
* @param Mage_Catalog_Model_Product $product
* @param Mage_Catalog_Model_Product|null $product
* @return $this
*/
public function setProduct(Mage_Catalog_Model_Product $product = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public function getGridUrl()
*/
protected function _addColumnFilterToCollection($column)
{
/** @var Mage_Wishlist_Model_Resource_Item_Collection $collection */
$collection = $this->getCollection();
$value = $column->getFilter()->getValue();
if ($collection && $value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function getArrayRows()
return $this->_arrayRowsCache;
}
$result = [];
/** @var Varien_Data_Form_Element_Abstract */
/** @var Varien_Data_Form_Element_Abstract $element */
$element = $this->getElement();
if ($element->getValue() && is_array($element->getValue())) {
foreach ($element->getValue() as $rowId => $row) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ protected function _beforeToHtml()
'content' => $this->getLayout()->createBlock('adminhtml/system_convert_profile_edit_tab_run')->toHtml(),
]);

/** @var Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_View
$block */
/** @var Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_View $block */
$block = $this->getLayout()->createBlock('adminhtml/system_convert_gui_edit_tab_view');
$this->addTab('view', [
'label' => Mage::helper('adminhtml')->__('Profile Actions XML'),
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ protected function _getNewCustomerEmail($customer)
protected function _putCustomerIntoQuote()
{
if (!$this->getSession()->getCustomer()->getId()) {
/** @var Mage_Customer_Model_Customer*/
/** @var Mage_Customer_Model_Customer $customer */
$customer = Mage::getModel('customer/customer');

$customer->addData($this->getBillingAddress()->exportCustomerAddress()->getData())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ public function cancelAction()

/**
* Saving quote and create order
*
* @throws Mage_Core_Exception
*/
public function saveAction()
{
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Api/Model/Acl/Assert/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Mage_Api_Model_Acl_Assert_Ip implements Zend_Acl_Assert_Interface
* Check whether ip is allowed
*
* @param Mage_Api_Model_Acl $acl
* @param Mage_Api_Model_Acl_Role $role
* @param Mage_Api_Model_Acl_Resource $resource
* @param string $privilege
* @return bool
* @param Mage_Api_Model_Acl_Role|null $role
* @param Mage_Api_Model_Acl_Resource|null $resource
* @param string|null $privilege
* @return bool|null
*/
public function assert(
Mage_Api_Model_Acl $acl,
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Api/Model/Acl/Assert/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Mage_Api_Model_Acl_Assert_Time implements Zend_Acl_Assert_Interface
* Assert time
*
* @param Mage_Api_Model_Acl $acl
* @param Mage_Api_Model_Acl_Role $role
* @param Mage_Api_Model_Acl_Resource $resource
* @param string $privilege
* @return bool
* @param Mage_Api_Model_Acl_Role|null $role
* @param Mage_Api_Model_Acl_Resource|null $resource
* @param string|null $privilege
* @return bool|null
*/
public function assert(
Mage_Api_Model_Acl $acl,
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Api/Model/Server/Wsi/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __call($function, $args)
{
$args = $args[0];

/** @var Mage_Api_Helper_Data */
/** @var Mage_Api_Helper_Data $helper */
$helper = Mage::helper('api/data');

$helper->wsiArrayUnpacker($args);
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Api2/Model/Multicall.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ protected function _callSubresource($subresource)
*
* @param Mage_Core_Model_Config_Element $subresource
* @param array $requestData
* @throws Mage_Api2_Exception
* @return $this
*/
protected function _internalCall($subresource, $requestData)
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Api2/Model/Route/ApiType.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Mage_Api2_Model_Route_ApiType extends Mage_Api2_Model_Route_Abstract imple
* @param string $route Map used to match with later submitted URL path
* @param array $defaults Defaults for map variables with keys as variable names
* @param array $reqs Regular expression requirements for variables (keys as variable names)
* @param Zend_Translate $translator Translator to use for this instance
* @param Zend_Translate|null $translator Translator to use for this instance
* @param mixed $locale
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ public function getBundleOptions(Mage_Catalog_Model_Product_Configuration_Item_I
$optionsQuoteItemOption = $item->getOptionByCode('bundle_option_ids');
$bundleOptionsIds = $optionsQuoteItemOption ? unserialize($optionsQuoteItemOption->getValue(), ['allowed_classes' => false]) : [];
if ($bundleOptionsIds) {
/**
* @var Mage_Bundle_Model_Resource_Option_Collection
*/
/** @var Mage_Bundle_Model_Resource_Option_Collection $bundleOptionsIds */
sreichel marked this conversation as resolved.
Show resolved Hide resolved
$optionsCollection = $typeInstance->getOptionsByIds($bundleOptionsIds, $product);

// get and add bundle selections collection
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Bundle/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public function appendUpsellProducts($observer)
return $this;
}

/** @var Mage_Catalog_Model_Resource_Product_Collection $bundleCollection */
$bundleCollection = $product->getCollection()
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
->addStoreFilter()
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Bundle/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,6 @@ protected function _prepareProduct(Varien_Object $buyRequest, $product, $process
// Check if added selections are still on sale
foreach ($selections->getItems() as $key => $selection) {
if (!$selection->isSalable() && !$skipSaleableCheck) {
/** @var Mage_Bundle_Model_Option $_option */
$_option = $optionsCollection->getItemById($selection->getOptionId());
if (is_array($options[$_option->getId()]) && count($options[$_option->getId()]) > 1) {
$moreSelections = true;
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Block/Product/View/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getProduct()
/**
* Set product object
*
* @param Mage_Catalog_Model_Product $product
* @param Mage_Catalog_Model_Product|null $product
* @return $this
*/
public function setProduct(Mage_Catalog_Model_Product $product = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ abstract class Mage_Catalog_Block_Product_View_Options_Abstract extends Mage_Cor
/**
* Set Product object
*
* @param Mage_Catalog_Model_Product $product
* @return Mage_Catalog_Block_Product_View_Options_Abstract
* @param Mage_Catalog_Model_Product|null $product
* @return $this
*/
public function setProduct(Mage_Catalog_Model_Product $product = null)
{
Expand Down
4 changes: 1 addition & 3 deletions app/code/core/Mage/Catalog/Helper/Product/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ public function getGroupedOptions(Mage_Catalog_Model_Product_Configuration_Item_
}

$options = [];
/**
* @var Mage_Catalog_Model_Product_Type_Grouped
*/
/** @var Mage_Catalog_Model_Product_Type_Grouped $typeInstance */
$typeInstance = $product->getTypeInstance(true);
$associatedProducts = $typeInstance->getAssociatedProducts($product);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ protected function _delete()
/**
* Retrieve product images data
*
* @throws Mage_Api2_Exception
* @return array
*/
protected function _retrieveCollection()
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Compare/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function bindCustomerLogin()
/**
* Customer logout bind process
*
* @param Varien_Event_Observer $observer
* @param Varien_Event_Observer|null $observer
* @return $this
*/
public function bindCustomerLogout(Varien_Event_Observer $observer = null)
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function getProduct()
/**
* Set product instance
*
* @param Mage_Catalog_Model_Product $product
* @param Mage_Catalog_Model_Product|null $product
* @return $this
*/
public function setProduct(Mage_Catalog_Model_Product $product = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public function validateUserValue($values)
/**
* Prepare option value for cart
*
* @throws Mage_Core_Exception
* @return mixed Prepared option value
* @return array|int|string|null Prepared option value
sreichel marked this conversation as resolved.
Show resolved Hide resolved
*/
public function prepareForCart()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,9 @@ public function catalogCategorySave(Mage_Index_Model_Event $event)
/**
* Reindex not anchor root categories
*
* @param array $categoryIds
* @param array|null $categoryIds
* @return $this
* @throws Zend_Db_Adapter_Exception
*/
protected function _refreshNotAnchorRootCategories(array $categoryIds = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ public function isEnabledFlat()
}
$storeId = $this->getStoreId();
if (!isset($this->_flatEnabled[$storeId])) {
/** @var Mage_Catalog_Helper_Product_Flat $flatHelper */
$flatHelper = $this->getFlatHelper();
$this->_flatEnabled[$storeId] = $flatHelper->isAccessible() && $flatHelper->isBuilt($storeId);
}
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Centinel/Model/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ protected function _getSession()
/**
* Return value from section of centinel config
*
* @param string $path
* @return string
*/
protected function _getConfig()
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Checkout/Model/Api/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected function _updateAttributes($data, $object, $type, array $attributes =
*
* @param Mage_Core_Model_Abstract $object
* @param string $type
* @param array $attributes
* @param array|null $attributes
* @return array
*/
protected function _getAttributes($object, $type, array $attributes = null)
Expand Down Expand Up @@ -205,7 +205,7 @@ protected function _getAttributes($object, $type, array $attributes = null)
*
* @param string $attributeCode
* @param string $type
* @param array $attributes
* @param array|null $attributes
* @return bool
*/
protected function _isAllowedAttribute($attributeCode, $type, array $attributes = null)
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ public function getFilesCollection($path, $type = null)
}
}

/** @var Varien_Data_Collection_Filesystem $collection */
$collection = $this->getCollection($path)
->setCollectDirs(false)
->setCollectFiles(true)
Expand Down
3 changes: 1 addition & 2 deletions app/code/core/Mage/Core/Controller/Request/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Mage_Core_Controller_Request_Http extends Zend_Controller_Request_Http
* This value is calculated instead of reading PATH_INFO
* directly from $_SERVER due to cross-platform differences.
*
* @return string
* @return string 'something.html'|'/'|'/path0'|'/path0/path1/'|'/path0/path1/path2'|etc
*/
public function getOriginalPathInfo()
{
Expand Down Expand Up @@ -237,7 +237,6 @@ public function getDirectFrontNames()

/**
* @return Zend_Controller_Request_Http
* @throws Zend_Controller_Request_Exception
*/
public function getOriginalRequest()
{
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Core/Controller/Varien/Front.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ protected function _isAdminFrontNameMatched($request)

if (is_array($adminFrontNameNodes)) {
foreach ($adminFrontNameNodes as $frontNameNode) {
/** @var SimpleXMLElement $frontNameNode */
$adminFrontNames[] = (string)$frontNameNode;
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Core/Model/Url/Rewrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ public function removeTag($tags)
/**
* Implement logic of custom rewrites
*
* @param Zend_Controller_Request_Http $request
* @param Zend_Controller_Response_Http $response
* @param Zend_Controller_Request_Http|null $request
* @param Zend_Controller_Response_Http|null $response
* @return bool
* @throws Mage_Core_Model_Store_Exception
* @deprecated since 1.7.0.2. Refactored and moved to Mage_Core_Controller_Request_Rewrite
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Customer/Block/Form/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public function canShowLogin()
if (Mage::getStoreConfigFlag(Mage_Customer_Helper_Data::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD)) {
$url = Mage::helper('customer')->getDashboardUrl();
} else {
/** @var string $pathInfo 'something.html'|'/'|'/path0'|'/path0/path1/'|'/path0/path1/path2'|etc */
$pathInfo = $this->getRequest()->getOriginalPathInfo();
if (strtolower(substr($pathInfo, -5)) === '.html') {
// For URL rewrite, preserve the path without considering query or post.
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Customer/Model/Api/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Mage_Customer_Model_Api_Resource extends Mage_Api_Model_Resource_Abstract
* Check is attribute allowed
*
* @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
* @param array $filter
* @param array|null $filter
* @return bool
*/
protected function _isAllowedAttribute($attribute, array $filter = null)
Expand All @@ -64,7 +64,7 @@ protected function _isAllowedAttribute($attribute, array $filter = null)
* Return list of allowed attributes
*
* @param Mage_Eav_Model_Entity_Abstract $entity
* @param array $filter
* @param array|null $filter
* @return array
*/
public function getAllowedAttributes($entity, array $filter = null)
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Directory/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ protected function _getRegions($storeId)

/** @var Mage_Directory_Model_Region $regionModel */
$regionModel = $this->_factory->getModel('directory/region');
/** @var Mage_Directory_Model_Resource_Region_Collection $collection */
$collection = $regionModel->getResourceCollection()
->addCountryFilter($countryIds)
->load();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** @var Mage_Core_Model_Resource_Setup $this */
$installer = $this;

/** @var Varien_Db_Adapter_Pdo_Mysql */
/** @var Varien_Db_Adapter_Pdo_Mysql $connection */
$connection = $this->getConnection();

$regionTable = $installer->getTable('directory/country_region');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** @var Mage_Core_Model_Resource_Setup $this */
$installer = $this;

/** @var Varien_Db_Adapter_Pdo_Mysql */
/** @var Varien_Db_Adapter_Pdo_Mysql $connection */
$connection = $this->getConnection();

$regionTable = $installer->getTable('directory/country_region');
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object)
/**
* Save additional attribute data after save attribute
*
* @param Mage_Eav_Model_Entity_Attribute|Mage_Eav_Model_Entity_Attribute $object
* @param Mage_Eav_Model_Entity_Attribute $object
* @inheritDoc
*/
protected function _afterSave(Mage_Core_Model_Abstract $object)
Expand Down
Loading