diff --git a/.phpstan.baseline.neon b/.phpstan.baseline.neon index 0c7663936..31f0f964c 100644 --- a/.phpstan.baseline.neon +++ b/.phpstan.baseline.neon @@ -438,12 +438,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php - - - message: '#^Ternary operator condition is always true\.$#' - identifier: ternary.alwaysTrue - count: 1 - path: app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php - - message: '#^Method Mage_Adminhtml_Controller_Action\:\:_setForcedFormKeyActions\(\) invoked with 2 parameters, 1 required\.$#' identifier: arguments.count @@ -2467,34 +2461,22 @@ parameters: path: app/code/core/Mage/Customer/Block/Account/Navigation.php - - message: '#^Method Mage_Customer_Block_Address_Edit\:\:getCountryId\(\) should return int but returns string\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Customer/Block/Address/Edit.php - - - - message: '#^Return type \(int\) of method Mage_Customer_Block_Address_Edit\:\:getCountryId\(\) should be compatible with return type \(string\) of method Mage_Directory_Block_Data\:\:getCountryId\(\)$#' - identifier: method.childReturnType - count: 1 - path: app/code/core/Mage/Customer/Block/Address/Edit.php - - - - message: '#^Method Mage_Customer_Block_Form_Register\:\:getCountryId\(\) should return int but returns string\.$#' + message: '#^Method Mage_Customer_Block_Newsletter\:\:getAction\(\) should return Mage_Core_Controller_Varien_Action but returns string\.$#' identifier: return.type count: 1 - path: app/code/core/Mage/Customer/Block/Form/Register.php + path: app/code/core/Mage/Customer/Block/Newsletter.php - - message: '#^Return type \(int\) of method Mage_Customer_Block_Form_Register\:\:getCountryId\(\) should be compatible with return type \(string\) of method Mage_Directory_Block_Data\:\:getCountryId\(\)$#' - identifier: method.childReturnType - count: 1 - path: app/code/core/Mage/Customer/Block/Form/Register.php + message: '#^Method Mage_Eav_Model_Entity_Attribute_Source_Interface\:\:getAllOptions\(\) invoked with 1 parameter, 0 required\.$#' + identifier: arguments.count + count: 2 + path: app/code/core/Mage/Customer/Helper/Address.php - - message: '#^Method Mage_Customer_Block_Newsletter\:\:getAction\(\) should return Mage_Core_Controller_Varien_Action but returns string\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Customer/Block/Newsletter.php + message: '#^Method Mage_Eav_Model_Entity_Attribute_Source_Interface\:\:getAllOptions\(\) invoked with 1 parameter, 0 required\.$#' + identifier: arguments.count + count: 2 + path: app/code/core/Mage/Customer/Helper/Data.php - message: '#^Property Mage_Customer_Helper_Data\:\:\$_customer \(Mage_Customer_Model_Customer\) in empty\(\) is not falsy\.$#' @@ -4830,24 +4812,6 @@ parameters: count: 19 path: app/design/adminhtml/default/default/template/catalog/category/widget/tree.phtml - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: app/design/adminhtml/default/default/template/catalog/product/attribute/new/created.phtml - - - - message: '#^Call to protected method _getHeader\(\) of class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main\.$#' - identifier: method.protected - count: 1 - path: app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml - - message: '#^Call to protected method _getHeader\(\) of class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Toolbar_Main\.$#' identifier: method.protected @@ -5004,6 +4968,18 @@ parameters: count: 63 path: app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml + - + message: '#^Call to protected method _getHeader\(\) of class Mage_Eav_Block_Adminhtml_Attribute_Set_Add\.$#' + identifier: method.protected + count: 1 + path: app/design/adminhtml/default/default/template/eav/attribute/set/add.phtml + + - + message: '#^Call to protected method _getHeader\(\) of class Mage_Eav_Block_Adminhtml_Attribute_Set_Edit\.$#' + identifier: method.protected + count: 1 + path: app/design/adminhtml/default/default/template/eav/attribute/set/edit.phtml + - message: '#^Variable \$this might not be defined\.$#' identifier: variable.undefined @@ -6306,12 +6282,6 @@ parameters: count: 10 path: app/design/frontend/base/default/template/checkout/multishipping/success.phtml - - - message: '#^Cannot call method isEnabled\(\) on Mage_Core_Block_Abstract\|false\.$#' - identifier: method.nonObject - count: 4 - path: app/design/frontend/base/default/template/checkout/onepage/billing.phtml - - message: '#^Variable \$this might not be defined\.$#' identifier: variable.undefined @@ -6576,42 +6546,6 @@ parameters: count: 4 path: app/design/frontend/base/default/template/customer/balance.phtml - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: app/design/frontend/base/default/template/customer/form/address.phtml - - - - message: '#^Variable \$address might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: app/design/frontend/base/default/template/customer/form/address.phtml - - - - message: '#^Variable \$countries might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: app/design/frontend/base/default/template/customer/form/address.phtml - - - - message: '#^Variable \$data might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: app/design/frontend/base/default/template/customer/form/address.phtml - - - - message: '#^Variable \$primaryTypes might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: app/design/frontend/base/default/template/customer/form/address.phtml - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 50 - path: app/design/frontend/base/default/template/customer/form/address.phtml - - message: '#^Variable \$action might not be defined\.$#' identifier: variable.undefined @@ -6633,7 +6567,7 @@ parameters: - message: '#^Variable \$this might not be defined\.$#' identifier: variable.undefined - count: 36 + count: 23 path: app/design/frontend/base/default/template/customer/form/edit.phtml - @@ -6648,12 +6582,6 @@ parameters: count: 16 path: app/design/frontend/base/default/template/customer/form/newsletter.phtml - - - message: '#^Cannot call method isEnabled\(\) on Mage_Core_Block_Abstract\|false\.$#' - identifier: method.nonObject - count: 3 - path: app/design/frontend/base/default/template/customer/form/register.phtml - - message: '#^PHPDoc tag @var contains unresolvable type\.$#' identifier: varTag.unresolvableType @@ -7572,42 +7500,6 @@ parameters: count: 3 path: app/design/frontend/rwd/default/template/customer/account/navigation.phtml - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: app/design/frontend/rwd/default/template/customer/form/address.phtml - - - - message: '#^Variable \$address might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: app/design/frontend/rwd/default/template/customer/form/address.phtml - - - - message: '#^Variable \$countries might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: app/design/frontend/rwd/default/template/customer/form/address.phtml - - - - message: '#^Variable \$data might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: app/design/frontend/rwd/default/template/customer/form/address.phtml - - - - message: '#^Variable \$primaryTypes might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: app/design/frontend/rwd/default/template/customer/form/address.phtml - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 51 - path: app/design/frontend/rwd/default/template/customer/form/address.phtml - - message: '#^Variable \$action might not be defined\.$#' identifier: variable.undefined @@ -7626,12 +7518,6 @@ parameters: count: 13 path: app/design/frontend/rwd/default/template/customer/form/confirmation.phtml - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 36 - path: app/design/frontend/rwd/default/template/customer/form/edit.phtml - - message: '#^Variable \$this might not be defined\.$#' identifier: variable.undefined diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php index 98445acab..01a6e4169 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php @@ -34,6 +34,8 @@ public function preDispatch() // For backwards compatibility set camelCase registry key with type id Mage::register('entityType', $this->entityType->getEntityTypeId()); + + return $this; } #[\Override] diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php index 0e4748e34..f8b475888 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php @@ -18,7 +18,7 @@ */ abstract class Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface { - /** @var Mage_Eav_Model_Entity_Attribute $_attribute */ + /** @var ?Mage_Eav_Model_Entity_Attribute $_attribute */ protected $_attribute = null; /** diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php index 386c4e50a..da0f7a582 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php @@ -18,7 +18,7 @@ */ abstract class Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface { - /** @var Mage_Eav_Model_Entity_Attribute $_attribute */ + /** @var ?Mage_Eav_Model_Entity_Attribute $_attribute */ protected $_attribute = null; public function __construct() diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Renderer/Fieldset/Element.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Renderer/Fieldset/Element.php index 80ae38e0d..ebaef2334 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Renderer/Fieldset/Element.php @@ -26,10 +26,8 @@ public function __construct() /** * Check "Use default" checkbox display availability - * - * @return bool */ - protected function canDisplayUseDefault() + public function canDisplayUseDefault(): bool { $attributeObject = $this->getElement()->getForm()->getDataObject(); if ($attributeObject->getWebsite() && (int)$attributeObject->getWebsite()->getId()) { @@ -40,10 +38,8 @@ protected function canDisplayUseDefault() /** * Check default value usage fact - * - * @return bool */ - protected function usedDefault() + public function usedDefault(): bool { $field = $this->getElement()->getId(); if (str_starts_with($field, 'default_value')) { @@ -55,10 +51,8 @@ protected function usedDefault() /** * Disable field in default value using case - * - * @return $this */ - public function checkFieldDisable() + public function checkFieldDisable(): self { if ($this->canDisplayUseDefault() && $this->usedDefault()) { $this->getElement()->setDisabled(true); @@ -70,10 +64,8 @@ public function checkFieldDisable() * Retrieve label of attribute scope * * GLOBAL | WEBSITE - * - * @return string */ - protected function getScopeLabel() + public function getScopeLabel(): string { $html = ''; if (Mage::app()->isSingleStoreMode()) { diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set/Edit.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set/Edit.php index 33217dcb1..ae0fa60b4 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set/Edit.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set/Edit.php @@ -192,7 +192,7 @@ protected function getGroupTree(): array ->setSortOrder() ->load(); - /** @var Mage_Eav_Model_Entity_Attribute_Group $node */ + /** @var Mage_Eav_Model_Entity_Attribute_Group $group */ foreach ($groups as $group) { $item = []; $item['text'] = $group->getAttributeGroupName(); diff --git a/app/design/adminhtml/default/default/template/website/switcher.phtml b/app/design/adminhtml/default/default/template/website/switcher.phtml index ea813ef8f..30c668133 100644 --- a/app/design/adminhtml/default/default/template/website/switcher.phtml +++ b/app/design/adminhtml/default/default/template/website/switcher.phtml @@ -9,8 +9,9 @@ * @copyright Copyright (c) 2024 Maho (https://mahocommerce.com) * @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ + +/** @var Mage_Adminhtml_Block_Website_Switcher $this */ ?> - getWebsites()): ?>