Skip to content

Fixed PHP 8.2 deprecation warnings: 'creation of dynamic property'. #905

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

Conversation

hostep
Copy link
Contributor

@hostep hostep commented Jun 3, 2023

Description

This fixes most PHP 8.2 deprecated usages of 'creation of dynamic property': https://www.php.net/manual/en/migration82.deprecated.php#migration82.deprecated.core.dynamic-properties

The phpstan tool is able to find these problems:

$ /path/to/phpstan analyse --level=0 src | grep 'Access to an undefined property'
  66     Access to an undefined property Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter::$options.
  67     Access to an undefined property Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter::$options.
  187    Access to an undefined property Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter::$emptyStep.
  51     Access to an undefined property Magento\FunctionalTestingFramework\Config\Reader::$isValidated.
  68     Access to an undefined property Magento\FunctionalTestingFramework\ObjectManager\Config\Reader\Dom::$_idAttributes.
  68     Access to an undefined property Magento\FunctionalTestingFramework\ObjectManager\Config\Reader\Dom::$_perFileSchema.
  75     Access to an undefined property Magento\FunctionalTestingFramework\StaticCheck\CreatedDataFromOutsideActionGroupCheck::$actionGroupXmlFile.
  133    Access to an undefined property Magento\FunctionalTestingFramework\StaticCheck\CreatedDataFromOutsideActionGroupCheck::$actionGroupXmlFile.
  49     Access to an undefined property Magento\FunctionalTestingFramework\StaticCheck\UnusedEntityCheck::$errors.
  50     Access to an undefined property Magento\FunctionalTestingFramework\StaticCheck\UnusedEntityCheck::$output.
  622    Access to an undefined property Magento\FunctionalTestingFramework\StaticCheck\UnusedEntityCheck::$errors.
  632    Access to an undefined property Magento\FunctionalTestingFramework\StaticCheck\UnusedEntityCheck::$output.
  340    Access to an undefined property Magento\FunctionalTestingFramework\Test\Objects\TestObject::$customData.

$ /path/to/phpstan analyse --level=0 dev | grep 'Access to an undefined property'
  45     Access to an undefined property tests\unit\Magento\FunctionalTestFramework\Util\UnusedEntityCheckTest::$scriptUtil.
  85     Access to an undefined property tests\unit\Magento\FunctionalTestFramework\Util\UnusedEntityCheckTest::$scriptUtil.
  122    Access to an undefined property tests\unit\Magento\FunctionalTestFramework\Util\UnusedEntityCheckTest::$scriptUtil.
  167    Access to an undefined property tests\unit\Magento\FunctionalTestFramework\Util\UnusedEntityCheckTest::$scriptUtil.

Since I'm not familiar with this MFTF tool, please review all changes carefully.

Fixed Issues (if relevant)

  1. https://github.com/magento/adobe-commerce-beta/issues/61

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@hostep hostep force-pushed the fix-php82-deprecated-dynamic-properties branch from 85f4c9c to dc177d8 Compare June 3, 2023 10:52
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit fe46644 into magento:develop Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants