Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
108 changes: 6 additions & 102 deletions .phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1230,12 +1230,6 @@ parameters:
count: 1
path: app/code/core/Mage/Catalog/Block/Product/Compare/List.php

-
rawMessage: 'Property Mage_Catalog_Block_Product_List_Toolbar::$_collection (Mage_Core_Model_Resource_Db_Collection_Abstract) does not accept Varien_Data_Collection.'
identifier: assign.propertyType
count: 1
path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php

-
rawMessage: 'Parameter #1 $price of method Mage_Core_Model_Store::convertPrice() expects float, string given.'
identifier: argument.type
Expand Down Expand Up @@ -1806,12 +1800,6 @@ parameters:
count: 1
path: app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php

-
rawMessage: 'Parameter #2 $alias of method Varien_Db_Adapter_Interface::quoteColumnAs() expects string, null given.'
identifier: argument.type
count: 2
path: app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php

-
rawMessage: 'Property Mage_Catalog_Model_Resource_Config::$_storeId (int) on left side of ?? is not nullable.'
identifier: nullCoalesce.property
Expand Down Expand Up @@ -1932,12 +1920,6 @@ parameters:
count: 1
path: app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php

-
rawMessage: 'Parameter #2 $alias of method Varien_Db_Adapter_Interface::quoteColumnAs() expects string, null given.'
identifier: argument.type
count: 1
path: app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php

-
rawMessage: Left side of && is always true.
identifier: booleanAnd.leftAlwaysTrue
Expand Down Expand Up @@ -2154,12 +2136,6 @@ parameters:
count: 1
path: app/code/core/Mage/Checkout/Block/Cart/Abstract.php

-
rawMessage: 'Parameter #1 $productThumbnail of method Mage_Checkout_Block_Cart_Item_Renderer::overrideProductThumbnail() expects Mage_Catalog_Helper_Image, null given.'
identifier: argument.type
count: 1
path: app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php

-
rawMessage: PHPDoc tag @var with type Mage_Sales_Model_Quote_Item is not subtype of native type null.
identifier: varTag.nativeType
Expand Down Expand Up @@ -2298,12 +2274,6 @@ parameters:
count: 2
path: app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php

-
rawMessage: 'Parameter #1 $array of function array_unshift expects array, null given.'
identifier: argument.type
count: 1
path: app/code/core/Mage/ConfigurableSwatches/Model/System/Config/Source/Catalog/Product/Configattribute/Select.php

-
rawMessage: 'Method Mage_Core_Block_Abstract::getParentBlock() should return $this(Mage_Core_Block_Abstract) but returns Mage_Core_Block_Abstract.'
identifier: return.type
Expand Down Expand Up @@ -2700,12 +2670,6 @@ parameters:
count: 1
path: app/code/core/Mage/Core/Model/Resource/Session.php

-
rawMessage: 'Parameter #1 $hook of method Varien_Db_Adapter_Pdo_Mysql::setQueryHook() expects array, null given.'
identifier: argument.type
count: 1
path: app/code/core/Mage/Core/Model/Resource/Setup.php

-
rawMessage: 'Property Mage_Core_Model_Resource_Setup::$_resourceConfig (Mage_Core_Model_Config_Element) does not accept SimpleXMLElement.'
identifier: assign.propertyType
Expand Down Expand Up @@ -3312,12 +3276,6 @@ parameters:
count: 1
path: app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php

-
rawMessage: 'Parameter #2 $alias of method Varien_Db_Adapter_Interface::quoteColumnAs() expects string, null given.'
identifier: argument.type
count: 4
path: app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php

-
rawMessage: 'Property Mage_Eav_Model_Entity_Collection_Abstract::$_entity (Mage_Eav_Model_Entity_Abstract) in empty() is not falsy.'
identifier: empty.property
Expand Down Expand Up @@ -3426,12 +3384,6 @@ parameters:
count: 4
path: app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php

-
rawMessage: 'Parameter #1 $limit of method Mage_Adminhtml_Block_Widget_Grid::setDefaultLimit() expects int, null given.'
identifier: argument.type
count: 1
path: app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php

-
rawMessage: 'Method Mage_Eav_Model_Entity_Attribute_Source_Interface::getAllOptions() invoked with 1 parameter, 0 required.'
identifier: arguments.count
Expand Down Expand Up @@ -3480,6 +3432,12 @@ parameters:
count: 1
path: app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php

-
rawMessage: 'Method Mage_ImportExport_Model_Resource_Import_Data::getIterator() should return IteratorIterator but returns Traversable<mixed, mixed>.'
identifier: return.type
count: 1
path: app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php

-
rawMessage: 'Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, array<string, int|string>|null given.'
identifier: argument.type
Expand Down Expand Up @@ -3552,24 +3510,12 @@ parameters:
count: 1
path: app/code/core/Mage/Newsletter/Model/Subscriber.php

-
rawMessage: 'Parameter #2 $idFieldName of method Mage_Core_Model_Resource_Db_Abstract::_init() expects string, null given.'
identifier: argument.type
count: 1
path: app/code/core/Mage/Oauth/Model/Resource/Nonce.php

-
rawMessage: 'Parameter #2 $value of method Varien_Data_Collection::addFilter() expects array|string, int given.'
identifier: argument.type
count: 4
path: app/code/core/Mage/Oauth/Model/Resource/Token/Collection.php

-
rawMessage: 'Parameter #1 $data of method Mage_Oauth_Adminhtml_Oauth_ConsumerController::_setFormData() expects array, null given.'
identifier: argument.type
count: 2
path: app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/ConsumerController.php

-
rawMessage: 'Call to an undefined method Mage_Payment_Model_Method_Abstract::isPartialAuthorization().'
identifier: method.notFound
Expand Down Expand Up @@ -4164,12 +4110,6 @@ parameters:
count: 1
path: app/code/core/Mage/Sales/Model/Order/Creditmemo.php

-
rawMessage: 'Parameter #2 $options of method Mage_Directory_Model_Currency::format() expects array, null given.'
identifier: argument.type
count: 1
path: app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php

-
rawMessage: 'Parameter #1 $incrementId of method Mage_Sales_Model_Order_Invoice::loadByIncrementId() expects string, int given.'
identifier: argument.type
Expand Down Expand Up @@ -4512,12 +4452,6 @@ parameters:
count: 2
path: app/code/core/Mage/SalesRule/Model/Validator.php

-
rawMessage: 'Parameter #2 $title of method Mage_Weee_Helper_Data::setWeeeTaxesAppliedProperty() expects string, null given.'
identifier: argument.type
count: 2
path: app/code/core/Mage/SalesRule/Model/Validator.php

-
rawMessage: 'Parameter #4 $value of method Mage_Weee_Helper_Data::setWeeeTaxesAppliedProperty() expects string, (float|int) given.'
identifier: argument.type
Expand Down Expand Up @@ -4674,18 +4608,6 @@ parameters:
count: 1
path: app/code/core/Mage/Tax/Helper/Data.php

-
rawMessage: 'Parameter #1 $request of method Mage_Tax_Model_Resource_Calculation::getCalculationProcess() expects Varien_Object, null given.'
identifier: argument.type
count: 1
path: app/code/core/Mage/Tax/Model/Calculation.php

-
rawMessage: 'Property Mage_Tax_Model_Calculation::$_defaultCustomerTaxClass (string) does not accept int.'
identifier: assign.propertyType
count: 1
path: app/code/core/Mage/Tax/Model/Calculation.php

-
rawMessage: 'Property Mage_Tax_Model_Calculation_Rate::$_titles (array|null) does not accept Mage_Tax_Model_Resource_Calculation_Rate_Title_Collection.'
identifier: assign.propertyType
Expand Down Expand Up @@ -5268,12 +5190,6 @@ parameters:
count: 2
path: app/design/frontend/base/default/template/catalog/product/compare/list.phtml

-
rawMessage: 'Parameter #1 $order of method Mage_Catalog_Block_Product_List_Toolbar::getOrderUrl() expects string, null given.'
identifier: argument.type
count: 2
path: app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml

-
rawMessage: Left side of && is always true.
identifier: booleanAnd.leftAlwaysTrue
Expand Down Expand Up @@ -5604,12 +5520,6 @@ parameters:
count: 2
path: app/design/frontend/rwd/default/template/catalog/product/compare/list.phtml

-
rawMessage: 'Parameter #1 $order of method Mage_Catalog_Block_Product_List_Toolbar::getOrderUrl() expects string, null given.'
identifier: argument.type
count: 2
path: app/design/frontend/rwd/default/template/catalog/product/list/toolbar.phtml

-
rawMessage: Left side of && is always true.
identifier: booleanAnd.leftAlwaysTrue
Expand Down Expand Up @@ -5988,12 +5898,6 @@ parameters:
count: 2
path: lib/Varien/Db/Adapter/Pdo/Mysql.php

-
rawMessage: 'Method Varien_Db_Adapter_Pdo_Mysql::query() should return Zend_Db_Statement_Pdo but returns PDOStatement|Zend_Db_Statement_Interface.'
identifier: return.type
count: 1
path: lib/Varien/Db/Adapter/Pdo/Mysql.php

-
rawMessage: 'Parameter #4 $result of method Varien_Db_Adapter_Pdo_Mysql::_debugStat() expects Zend_Db_Statement_Pdo|null, PDOStatement|Zend_Db_Statement_Interface given.'
identifier: argument.type
Expand Down
17 changes: 15 additions & 2 deletions app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ protected function _memorizeParam($param, $value)
/**
* Set collection to pager
*
* @param Varien_Data_Collection $collection
* @param Mage_Core_Model_Resource_Db_Collection_Abstract $collection
* @throws Exception
* @return $this
*/
public function setCollection($collection)
Expand Down Expand Up @@ -284,6 +285,7 @@ public function getLimitVarName()
/**
* Return current page from request
*
* @throws Exception
* @return int
*/
public function getCurrentPage()
Expand All @@ -298,6 +300,7 @@ public function getCurrentPage()
/**
* Get grit products sort order field
*
* @throws Exception
* @return string
*/
public function getCurrentOrder()
Expand Down Expand Up @@ -338,6 +341,7 @@ public function getCurrentOrder()
/**
* Retrieve current direction
*
* @throws Exception
* @return string
*/
public function getCurrentDirection()
Expand Down Expand Up @@ -452,6 +456,7 @@ public function removeOrderFromAvailableOrders($order)
* Compare defined order field vith current order field
*
* @param string $order
* @throws Exception
* @return bool
*/
public function isOrderCurrent($order)
Expand All @@ -462,8 +467,9 @@ public function isOrderCurrent($order)
/**
* Retrieve Pager URL
*
* @param string $order
* @param null|string $order
* @param string $direction
* @throws Exception
* @return string
*/
public function getOrderUrl($order, $direction)
Expand Down Expand Up @@ -498,6 +504,7 @@ public function getPagerUrl($params = [])
/**
* Retrieve current View mode
*
* @throws Exception
* @return string
*/
public function getCurrentMode()
Expand Down Expand Up @@ -532,6 +539,7 @@ public function getCurrentMode()
* Compare defined view mode with current active mode
*
* @param string $mode
* @throws Exception
* @return bool
*/
public function isModeActive($mode)
Expand Down Expand Up @@ -642,6 +650,7 @@ public function isExpanded()
/**
* Retrieve default per page values
*
* @throws Exception
* @return string (comma separated)
*/
public function getDefaultPerPageValue()
Expand Down Expand Up @@ -684,6 +693,7 @@ public function addPagerLimit($mode, $value, $label = '')
/**
* Retrieve available limits for current view mode
*
* @throws Exception
* @return array
*/
public function getAvailableLimit()
Expand Down Expand Up @@ -722,6 +732,7 @@ protected function _getAvailableLimit($mode)
/**
* Get specified products limit display per page
*
* @throws Exception
* @return string
*/
public function getLimit()
Expand Down Expand Up @@ -773,6 +784,7 @@ public function getLimitUrl($limit)

/**
* @param int $limit
* @throws Exception
* @return bool
*/
public function isLimitCurrent($limit)
Expand Down Expand Up @@ -825,6 +837,7 @@ public function getLastPageNum()
/**
* Render pagination HTML
*
* @throws Exception
* @return string
*/
public function getPagerHtml()
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function getProduct()
}

/**
* @param Mage_Catalog_Helper_Image $productThumbnail
* @param null|Mage_Catalog_Helper_Image $productThumbnail
* @return $this
*/
public function overrideProductThumbnail($productThumbnail)
Expand Down Expand Up @@ -179,7 +179,7 @@ public function getProductName()
/**
* Get product customize options
*
* @return array|false
* @return array
*/
public function getProductOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Mage_ConfigurableSwatches_Model_System_Config_Source_Catalog_Product_Confi
/**
* Attributes array
*
* @var null|array
* @var array
*/
protected $_attributes = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ public function toOptionArray()
{
if (is_null($this->_attributes)) {
parent::toOptionArray();
$attributes = $this->_attributes;

array_unshift(
$this->_attributes,
$attributes,
[
'value' => '',
'label' => Mage::helper('configurableswatches')->__('-- Please Select --'),
],
);

$this->_attributes = $attributes;
}

return $this->_attributes;
Expand Down
Loading
Loading