magento2
magento2 copied to clipboard
add phpstan-deprecation-rules
Description (*)
Static Tests: add phpstan/phpstan-deprecation-rules for detecting usage of deprecated classes, methods, properties, constants and traits.
Related Pull Requests
Manual testing scenarios (*)
- ...
- ...
Questions or comments
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/integration tests (if applicable)
- [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [ ] All automated tests passed successfully (all builds are green)
Resolved issues:
- [x] resolves magento/magento2#36157: add phpstan-deprecation-rules
Hi @rogerdz. Thank you for your contribution Here are some useful tips how you can test your changes using Magento test environment. Add the comment under your pull request to deploy test or vanilla Magento instance:
@magento give me test instance- deploy test instance based on PR changes@magento give me 2.4-develop instance- deploy vanilla Magento instance
:exclamation: Automated tests can be triggered manually with an appropriate comment:
@magento run all tests- run or re-run all required tests against the PR changes@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names. Allowed build names are:
Database CompareFunctional Tests CEFunctional Tests EE,Functional Tests B2BIntegration TestsMagento Health IndexSample Data Tests CESample Data Tests EESample Data Tests B2BStatic TestsUnit TestsWebAPI TestsSemantic Version Checker
You can find more information about the builds here
:information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Magento Contributor Guide documentation.
:warning: According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento create issue
@magento run Functional Tests EE
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
Hi @rogerdz,
We have verify the package is installed correctly.

But while verifying changes no warning is shown if deprecated function/class is being used. please refer to below screen shot and suggest if we are missing any steps here.
Before PR
we have checked using php vendor/bin/phpcs --standard=Magento2 to see if file contains any deprecated function/class.
when we are using vendor/bin/phpstan analyse on same file no warning is shown.

After PR
No changes are seen when we are using vendor/bin/phpstan analyse on same file

Please let us know if we are missing any steps here or any other way to verify changes.
Hi @engcom-Echo , right command is : vendor/bin/phpstan analyse --configuration dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon --level 1 --memory-limit=4G --error-format=filtered app/code/Magento/BundleSampleData/Model/Product.php

@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@rogerdz @edenduong Thanks for the collaboration & contribution!
:heavy_check_mark: QA Passed
add phpstan-deprecation-rules
Manual Scenario Steps
- New Magento installation run command mention in comment
Before: :heavy_multiplication_x:

After: :heavy_check_mark:
@magento run WebAPI Tests,Functional Tests EE,Integration Tests,Functional Tests CE
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run Integration Tests, Functional Tests B2B,Functional Tests CE
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
It seems bot moved this PR from Merge in Progress to Ready for Testing hence moving it back.
@magento run Static Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run Functional Tests EE, Functional Tests B2B, Functional Tests CE, Integration Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run Static Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
Moving this PR back to Changes Requested to update the PR branch with latest magento code and resolve the conflicts.
Thank you!
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.