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

Fix multiple "PHPDoc tag @param has invalid value" phpstan errors #2227

Merged
merged 1 commit into from Jun 14, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
445 changes: 0 additions & 445 deletions .github/phpstan-baseline.neon

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/Mage.php
Expand Up @@ -402,7 +402,7 @@ public static function getModuleDir($type, $moduleName)
* Retrieve config value for store by path
*
* @param string $path
* @param mixed $store
* @param null|string|bool|int|Mage_Core_Model_Store $store
* @return mixed
*/
public static function getStoreConfig($path, $store = null)
Expand Down
Expand Up @@ -119,7 +119,7 @@ protected function _afterLoadCollection()
}

/**
* @param $collection
* @param Varien_Data_Collection $collection
* @param Mage_Adminhtml_Block_Widget_Grid_Column $column
*/
protected function _filterStoreCondition($collection, $column)
Expand Down
Expand Up @@ -85,7 +85,7 @@ protected function _prepareColumns()
}

/**
* @param $row
* @param Mage_Admin_Model_Block $row
* @return string
*/
public function getRowUrl($row)
Expand Down
Expand Up @@ -86,7 +86,7 @@ protected function _prepareColumns()
}

/**
* @param $row
* @param Mage_Admin_Model_Variable $row
* @return string
*/
public function getRowUrl($row)
Expand Down
Expand Up @@ -72,7 +72,7 @@ public function getItems()
/**
* Add button to the items header
*
* @param $args array
* @param array $args
*/
public function addButton($args)
{
Expand Down
Expand Up @@ -211,8 +211,8 @@ public function getPackages()
/**
* Get item of shipment by its id
*
* @param $itemId
* @param $itemsOf
* @param int $itemId
* @param string $itemsOf
* @return Varien_Object
*/
public function getShipmentItem($itemId, $itemsOf)
Expand Down
Expand Up @@ -111,8 +111,8 @@ public function getCondition()

/**
* @deprecated after 1.5.0.0
* @param $value
* @return mixed
* @param array|string $value
* @return array|string
*/
protected function _escapeValue($value)
{
Expand Down
Expand Up @@ -45,8 +45,8 @@ class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Currency
/**
* Renders grid column
*
* @param Varien_Object $row
* @return string
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
{
Expand All @@ -69,7 +69,7 @@ public function render(Varien_Object $row)
/**
* Returns currency code, false on error
*
* @param $row
* @param Varien_Object $row
* @return string|false
*/
protected function _getCurrencyCode($row)
Expand All @@ -86,7 +86,7 @@ protected function _getCurrencyCode($row)
/**
* Get rate for current row, 1 by default
*
* @param $row
* @param Varien_Object $row
* @return float|int
*/
protected function _getRate($row)
Expand Down
Expand Up @@ -169,7 +169,7 @@ protected function _getXpathBlockValidationExpression()
* Validate template path for preventing access to the directory above
* If template path value has "../" @throws Exception
*
* @param $templatePaths | array
* @param array $templatePaths
*/
protected function _validateTemplatePath(array $templatePaths)
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Api2/Model/Dispatcher.php
Expand Up @@ -80,7 +80,7 @@ public function dispatch(Mage_Api2_Model_Request $request, Mage_Api2_Model_Respo
/**
* Pack resource model class path from components and try to load it
*
* @param $model
* @param string $model
* @param string $apiType API type
* @param string $userType API User type (e.g. admin, customer, guest)
* @param int $version Requested version
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Api2/Model/Resource.php
Expand Up @@ -293,7 +293,7 @@ public function dispatch()
/**
* Trigger error for not-implemented operations
*
* @param $methodName
* @param string $methodName
*/
protected function _errorIfMethodNotExist($methodName)
{
Expand All @@ -305,7 +305,7 @@ protected function _errorIfMethodNotExist($methodName)
/**
* Check method exist
*
* @param $methodName
* @param string $methodName
* @return bool
*/
protected function _checkMethodExist($methodName)
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Authorizenet/Helper/Data.php
Expand Up @@ -83,7 +83,7 @@ public function getSaveOrderUrlParams($controller)

/**
* Retrieve redirect iframe url
* @param $params
* @param array $params
* @return string
*/
public function getRedirectIframeUrl($params)
Expand Down
14 changes: 7 additions & 7 deletions app/code/core/Mage/Backup/Model/Resource/Db.php
Expand Up @@ -138,7 +138,7 @@ public function getTableForeignKeysSql($tableName = null)
* Retrieve table status
*
* @param string $tableName
* @return Varien_Object
* @return Varien_Object|false
*/
public function getTableStatus($tableName)
{
Expand Down Expand Up @@ -168,7 +168,7 @@ public function getTableStatus($tableName)
*
* @param string $tableName
* @param array $row
* @return string
* @return array
*/
protected function _quoteRow($tableName, array $row)
{
Expand All @@ -191,9 +191,9 @@ public function getTableDataSql($tableName, $count = null, $offset = null)
/**
* Enter description here...
*
* @param unknown_type $tableName
* @param unknown_type $addDropIfExists
* @return unknown
* @param string $tableName
* @param bool $addDropIfExists
* @return string
*/
public function getTableCreateScript($tableName, $addDropIfExists = false)
{
Expand All @@ -203,7 +203,7 @@ public function getTableCreateScript($tableName, $addDropIfExists = false)
/**
* Retrieve table header comment
*
* @param unknown_type $tableName
* @param string $tableName
* @return string
*/
public function getTableHeader($tableName)
Expand Down Expand Up @@ -306,7 +306,7 @@ public function rollBackTransaction()
/**
* Run sql code
*
* @param $command
* @param string|Zend_Db_Select $command
* @return $this
*/
public function runCommand($command){
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Catalog/Block/Product/List.php
Expand Up @@ -215,7 +215,7 @@ public function getToolbarHtml()
}

/**
* @param $collection
* @param Mage_Catalog_Model_Resource_Product_Collection $collection
* @return $this
*/
public function setCollection($collection)
Expand All @@ -225,7 +225,7 @@ public function setCollection($collection)
}

/**
* @param $code
* @param array|string|integer|Mage_Core_Model_Config_Element $code
* @return $this
* @throws Mage_Core_Exception
*/
Expand Down
5 changes: 4 additions & 1 deletion app/code/core/Mage/Catalog/Block/Product/View/Options.php
Expand Up @@ -34,6 +34,9 @@
*/
class Mage_Catalog_Block_Product_View_Options extends Mage_Core_Block_Template
{
/**
* @var Mage_Catalog_Model_Product
*/
protected $_product;

protected $_optionRenders = array();
Expand Down Expand Up @@ -111,7 +114,7 @@ public function getOptionRender($type)
}

/**
* @param $type
* @param string $type
* @return string
*/
public function getGroupOfOption($type)
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Block/Product/View/Tabs.php
Expand Up @@ -39,7 +39,7 @@ class Mage_Catalog_Block_Product_View_Tabs extends Mage_Core_Block_Template
/**
* Add tab to the container
*
* @param $alias
* @param string $alias
* @param string $title
* @param string $block
* @param string $template
Expand Down
Expand Up @@ -54,7 +54,7 @@ class Mage_Catalog_Model_Api2_Product_Validator_Product extends Mage_Api2_Model_

/**
* Mage_Catalog_Model_Api2_Product_Validator_Product constructor.
* @param $options
* @param array $options
* @throws Exception
*/
public function __construct($options)
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Config.php
Expand Up @@ -281,7 +281,7 @@ public function getProductTypeName($id)
}

/**
* @param $source
* @param Mage_Eav_Model_Entity_Attribute_Source_Interface $source
* @param string $value
* @return string|null
*/
Expand Down
Expand Up @@ -398,7 +398,7 @@ public function parse()
}

/**
* @param $items
* @param array $items
*/
public function setInventoryItems($items)
{
Expand Down
Expand Up @@ -35,7 +35,7 @@
class Mage_Catalog_Model_Entity_Product_Attribute_Frontend_Image extends Mage_Eav_Model_Entity_Attribute_Frontend_Abstract
{
/**
* @param $object
* @param Varien_Object $object
* @param string $size
* @return bool|string
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Condition.php
Expand Up @@ -52,7 +52,7 @@ public function applyToCollection($collection)

/**
* @param Magento_Db_Adapter_Pdo_Mysql $dbAdapter
* @return string
* @return string|Varien_Db_Select
*/
public function getIdsSelect($dbAdapter)
{
Expand Down
Expand Up @@ -34,7 +34,7 @@ public function applyToCollection($collection);

/**
* @param Magento_Db_Adapter_Pdo_Mysql $dbAdapter
* @return string
* @return string|Varien_Db_Select
*/
public function getIdsSelect($dbAdapter);
}
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Type.php
Expand Up @@ -169,7 +169,7 @@ public static function getOptions()
}

/**
* @param $optionId
* @param string $optionId
* @return mixed|null
*/
public static function getOptionText($optionId)
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/CatalogIndex/Model/Indexer.php
Expand Up @@ -814,8 +814,8 @@ public function prepareCatalogProductFlatIndexes(Varien_Object $object)
/**
* Update price process for catalog product flat
*
* @param $store
* @param mixed $products
* @param Mage_Core_Model_Store|int $store
* @param Mage_Catalog_Model_Product|int|array|null $products
* @param string $resourceTable
* @return $this
*/
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php
Expand Up @@ -87,7 +87,7 @@ protected function _loadAttribute($id)
* @param bool $minimal clear minimal price index data flag
* @param bool $finalPrice clear final price index data flag
* @param bool $tierPrice clear tier price index data flag
* @param mixed $products applicable products
* @param Mage_Catalog_Model_Product|Mage_Catalog_Model_Product_Condition_Interface|int|array|null $products applicable products
* @param mixed $store applicable stores
*/
public function clear(
Expand Down Expand Up @@ -640,7 +640,7 @@ public function prepareCatalogProductFlatIndexes(Varien_Object $object)
* Update prices for Catalog Product flat
*
* @param int $storeId
* @param array $productIds
* @param array|Mage_Catalog_Model_Product_Condition_Interface $productIds
* @param string $tableName
* @return $this
*/
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Checkout/Block/Cart/Totals.php
Expand Up @@ -42,7 +42,7 @@ public function getTotals()
}

/**
* @param $value
* @param array $value
* @return $this
*/
public function setTotals($value)
Expand All @@ -52,7 +52,7 @@ public function setTotals($value)
}

/**
* @param $code
* @param string $code
* @return false|Mage_Core_Block_Abstract|string
*/
protected function _getTotalRenderer($code)
Expand Down
Expand Up @@ -687,7 +687,7 @@ protected function _canShowForUnregisteredUsers()
/**
* Prepare JSON formatted data for response to client
*
* @param $response
* @param mixed $response
* @return Zend_Controller_Response_Abstract
*/
protected function _prepareDataJSON($response)
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Core/Block/Abstract.php
Expand Up @@ -898,8 +898,8 @@ protected function _beforeToHtml()
/**
* Specify block output frame tags
*
* @param $openTag
* @param $closeTag
* @param string $openTag
* @param string $closeTag
* @return $this
*/
public function setFrameTags($openTag, $closeTag = null)
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Core/Model/Config.php
Expand Up @@ -1050,8 +1050,8 @@ public function getDistroServerVars()
}

/**
* @param $data
* @return mixed
* @param string|array $data
* @return array|string
*/
public function substDistroServerVars($data)
{
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Core/Model/Email/Template/Filter.php
Expand Up @@ -510,7 +510,7 @@ public function customvarDirective($construction)
* Syntax: {{inlinecss file=""}} If this directive is used, the file will be stored on this object so that
* it can be retrieved later
*
* @param $construction
* @param array $construction
* @return string
*/
public function inlinecssDirective($construction)
Expand All @@ -525,7 +525,7 @@ public function inlinecssDirective($construction)
/**
* Set filename of CSS file to inline
*
* @param $filename
* @param string $filename
* @return $this
*/
protected function _setInlineCssFile($filename)
Expand Down