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

[PHP 8.2] Fixed deprecated dynamic property creation #3094

Merged
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
10 changes: 8 additions & 2 deletions app/code/core/Mage/Catalog/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* @category Mage
* @package Mage_Catalog
* @author Magento Core Team <core@magentocommerce.com>
*
* @property array $_productTypesByName
*/
class Mage_Catalog_Model_Config extends Mage_Eav_Model_Config
{
Expand All @@ -38,8 +36,16 @@ class Mage_Catalog_Model_Config extends Mage_Eav_Model_Config
protected $_attributeGroupsById;
protected $_attributeGroupsByName;

/**
* @var array
*/
protected $_productTypesById;

/**
* @var array
*/
protected $_productTypesByName;

/**
* Array of attributes codes needed for product load
*
Expand Down
7 changes: 5 additions & 2 deletions app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* @category Mage
* @package Mage_Catalog
* @author Magento Core Team <core@magentocommerce.com>
*
* @property string $_storesIdCode
*/
class Mage_Catalog_Model_Convert_Adapter_Product extends Mage_Eav_Model_Convert_Adapter_Entity
{
Expand Down Expand Up @@ -65,6 +63,11 @@ class Mage_Catalog_Model_Convert_Adapter_Product extends Mage_Eav_Model_Convert_

protected $_stores;

/**
* @var array
*/
protected $_storesIdCode = [];

protected $_attributes = [];

protected $_configs = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
* @package Mage_Catalog
* @author Magento Core Team <core@magentocommerce.com>
*
* @property string $_formattedOptionValue
*
* @method $this setConfigurationItemOption(Varien_Object $value)
* @method bool getIsValid()
* @method $this setIsValid(bool $value)
Expand Down Expand Up @@ -59,6 +57,11 @@ class Mage_Catalog_Model_Product_Option_Type_Default extends Varien_Object
*/
protected $_productOptions = [];

/**
* @var string|null
*/
protected $_formattedOptionValue = null;

/**
* Option Instance setter
*
Expand Down
13 changes: 10 additions & 3 deletions app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
* @package Mage_CatalogIndex
* @author Magento Core Team <core@magentocommerce.com>
*
* @property Mage_Directory_Model_Currency $_currencyModel
*
* @method Mage_CatalogIndex_Model_Resource_Indexer_Minimalprice _getResource()
* @method Mage_CatalogIndex_Model_Resource_Indexer_Minimalprice getResource()
* @method $this setEntityId(int $value)
Expand All @@ -44,7 +42,16 @@
*/
class Mage_CatalogIndex_Model_Indexer_Minimalprice extends Mage_CatalogIndex_Model_Indexer_Abstract
{
protected $_customerGroups = [];
/**
* @var Mage_Directory_Model_Currency
*/
protected $_currencyModel;

/**
* @var Mage_Customer_Model_Resource_Group_Collection
*/
protected $_customerGroups;

protected $_runOnce = true;
protected $_processChildren = false;

Expand Down
13 changes: 10 additions & 3 deletions app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
* @package Mage_CatalogIndex
* @author Magento Core Team <core@magentocommerce.com>
*
* @property Mage_Directory_Model_Currency $_currencyModel
* @property Mage_Customer_Model_Resource_Group_Collection $_customerGroups
*
* @method Mage_CatalogIndex_Model_Resource_Indexer_Price _getResource()
* @method Mage_CatalogIndex_Model_Resource_Indexer_Price getResource()
*
Expand All @@ -52,6 +49,16 @@
*/
class Mage_CatalogIndex_Model_Indexer_Tierprice extends Mage_CatalogIndex_Model_Indexer_Abstract
{
/**
* @var Mage_Directory_Model_Currency
*/
protected $_currencyModel;

/**
* @var Mage_Customer_Model_Resource_Group_Collection
*/
protected $_customerGroups;

protected $_processChildren = false;

protected function _construct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,24 @@
* @category Mage
* @package Mage_CatalogIndex
* @author Magento Core Team <core@magentocommerce.com>
*
* @property string $_attributeIdFieldName
* @property string $_entityIdFieldName
* @property string $_storeIdFieldName
*/
class Mage_CatalogIndex_Model_Resource_Indexer_Abstract extends Mage_Core_Model_Resource_Db_Abstract
{
/**
* @var string
*/
protected $_attributeIdFieldName;

/**
* @var string
*/
protected $_entityIdFieldName;

/**
* @var string
*/
protected $_storeIdFieldName;

/**
* should be defined because abstract
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,9 @@
* @category Mage
* @package Mage_CurrencySymbol
* @author Magento Core Team <core@magentocommerce.com>
*
* @property string $_blockGroup
*/
class Mage_CurrencySymbol_Block_Adminhtml_System_Currencysymbol extends Mage_Adminhtml_Block_Widget_Form
{
/**
* @var string
*/
private $_controller;

public function __construct()
{
$this->_blockGroup = 'currencysymbol_system';
$this->_controller = 'adminhtml_system_currencysymbol';
parent::__construct();
}

Comment on lines -33 to -44
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted this since I couldn't find any usages for those variables.

/**
* Custom currency symbol properties
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
* @category Mage
* @package Mage_Customer
* @author Magento Core Team <core@magentocommerce.com>
*
* @property Mage_Newsletter_Model_Subscriber|null $_subscription
*/
class Mage_Customer_Block_Account_Dashboard_Newsletter extends Mage_Core_Block_Template
{
/**
* @var Mage_Newsletter_Model_Subscriber|null
*/
protected $_subscription = null;

/**
* @return Mage_Newsletter_Model_Subscriber
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* @category Mage
* @package Mage_ImportExport
* @author Magento Core Team <core@magentocommerce.com>
*
* @property array $_invalidRows
*/
abstract class Mage_ImportExport_Model_Export_Entity_Abstract
{
Expand Down Expand Up @@ -72,6 +70,11 @@ abstract class Mage_ImportExport_Model_Export_Entity_Abstract
*/
protected $_errors = [];

/**
* @var array
*/
protected $_invalidRows = [];

/**
* Error counter.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* @category Mage
* @package Mage_Reports
* @author Magento Core Team <core@magentocommerce.com>
*
* @property Varien_Object $_totals
*/
class Mage_Reports_Model_Resource_Product_Collection extends Mage_Catalog_Model_Resource_Product_Collection
{
Expand Down Expand Up @@ -158,8 +156,6 @@ public function getProductEntityTypeId()
*/
protected function _joinFields()
{
$this->_totals = new Varien_Object();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No usages found for this variable.


$this->addAttributeToSelect('entity_id')
->addAttributeToSelect('name')
->addAttributeToSelect('price');
Expand Down
7 changes: 5 additions & 2 deletions app/code/core/Mage/Review/Block/Customer/Recent.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
* @category Mage
* @package Mage_Review
* @author Magento Core Team <core@magentocommerce.com>
*
* @property Mage_Review_Model_Resource_Review_Product_Collection $_collection
*/
class Mage_Review_Block_Customer_Recent extends Mage_Core_Block_Template
{
/**
* @var Mage_Review_Model_Resource_Review_Product_Collection
*/
protected $_collection;

public function __construct()
{
parent::__construct();
Expand Down
7 changes: 5 additions & 2 deletions lib/Varien/Io/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* @category Varien
* @package Varien_Io
* @author Magento Core Team <core@magentocommerce.com>
*
* @property mixed $_streamException
*/
class Varien_Io_File extends Varien_Io_Abstract
{
Expand Down Expand Up @@ -95,6 +93,11 @@ class Varien_Io_File extends Varien_Io_Abstract
*/
protected $_streamLocked = false;

/**
* @var Exception
*/
protected $_streamException;

public function __construct()
{
// Initialize shutdown function
Expand Down
5 changes: 0 additions & 5 deletions phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2475,11 +2475,6 @@ parameters:
count: 1
path: app/code/core/Mage/Core/functions.php

-
message: "#^Property Mage_CurrencySymbol_Block_Adminhtml_System_Currencysymbol\\:\\:\\$_controller is never read, only written\\.$#"
count: 1
path: app/code/core/Mage/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php

-
message: "#^Property Mage_CurrencySymbol_Model_System_Currencysymbol\\:\\:\\$_storeId \\(string\\|null\\) does not accept int\\|null\\.$#"
count: 1
Expand Down