Skip to content

Conversation

Den4ik
Copy link
Contributor

@Den4ik Den4ik commented Aug 26, 2021

Description (*)

This PR improve phpmd UnusedFormalParameter rule with ignoring of required unused parameters in the plugins.

  • around and after plugins has 2 required params $subject and $proceed (or $result for after plugin).
  • before plugin has 1 required param $subject.

This PR override standard UnusedFormalParameter rule and allow don't use @SuppressWarnings(PHPMD.UnusedFormalParameter) in the plugins.

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Configure phpmd
  2. Remove @SuppressWarnings(PHPMD.UnusedFormalParameter) from some plugin
  3. Add PluginInterface implementation into the class
  4. Run phpmd. Expected no UnusedFormalParameter errors

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:

  1. resolves [Issue] [PHPMD] Add phpmd rule with ignoring of unused required parameters in the plugins #37914: [PHPMD] Add phpmd rule with ignoring of unused required parameters in the plugins
… the plugins Signed-off-by: Denis Kopylov <dkopylov@magenius.team>
@m2-assistant
Copy link

m2-assistant bot commented Aug 26, 2021

Hi @Den4ik. 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

❗ 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:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@Den4ik
Copy link
Contributor Author

Den4ik commented Aug 26, 2021

@magento run all tests

@magento-automated-testing
Copy link

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.

Signed-off-by: Denis Kopylov <dkopylov@magenius.team>
@Den4ik
Copy link
Contributor Author

Den4ik commented Aug 26, 2021

@magento run all test

@magento-automated-testing
Copy link

Failed to run the builds. Please try to re-run them later.

@Den4ik
Copy link
Contributor Author

Den4ik commented Aug 26, 2021

@magento run all tests

@magento-automated-testing
Copy link

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.

@Den4ik
Copy link
Contributor Author

Den4ik commented Aug 26, 2021

@magento run WebAPI Tests, Integration Tests, Database Compare, Functional Tests B2B, Functional Tests CE

@magento-automated-testing
Copy link

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.

@Den4ik
Copy link
Contributor Author

Den4ik commented Aug 26, 2021

@magento run Database Compare

@magento-automated-testing
Copy link

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.

@Den4ik
Copy link
Contributor Author

Den4ik commented Aug 26, 2021

@magento run Database Compare

@magento-automated-testing
Copy link

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.

@ihor-sviziev ihor-sviziev added the Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. label Aug 27, 2021
@Den4ik Den4ik changed the title DO NOT PROCEED: [PHPMD] Add phpmd rule with ignoring of unused required parameters in the plugins [PHPMD] Add phpmd rule with ignoring of unused required parameters in the plugins Aug 27, 2021
@sidolov sidolov added the Priority: P3 May be fixed according to the position in the backlog. label Oct 28, 2021
@Den4ik
Copy link
Contributor Author

Den4ik commented Aug 8, 2022

@magento run all tests

@magento-automated-testing
Copy link

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.

@Den4ik
Copy link
Contributor Author

Den4ik commented Dec 2, 2022

@magento run all tests

@magento-automated-testing
Copy link

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.

@sinhaparul sinhaparul added the Project: Community Picked PRs upvoted by the community label Aug 16, 2023
@engcom-Lima engcom-Lima added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Aug 17, 2023
@engcom-Echo
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

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.

@engcom-Echo engcom-Echo self-assigned this Aug 23, 2023
@engcom-Echo
Copy link
Contributor

@magento run Unit Tests ,Functional Tests CE,Functional Tests EE,Functional Tests B2B

@magento-automated-testing
Copy link

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.

@engcom-Echo
Copy link
Contributor

@magento create issue

@engcom-Echo
Copy link
Contributor

engcom-Echo commented Aug 24, 2023

✔️ QA Passed

Manual testing scenario:

  1. Configure phpmd
  2. Remove @SuppressWarnings(PHPMD.UnusedFormalParameter) from some plugin
  3. Add PluginInterface implementation into the class
  4. Run phpmd. Expected no UnusedFormalParameter errors

Before: ✖️
Screenshot 2023-08-24 at 9 03 55 AM

After: ✔️
Screenshot 2023-08-24 at 9 11 50 AM

Builds are failed. Hence, moving this PR to Extended Testing.

@engcom-Echo
Copy link
Contributor

@magento run Unit Tests,Functional Tests CE,Functional Tests EE,Functional Tests B2B

@magento-automated-testing
Copy link

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.

@engcom-Echo
Copy link
Contributor

@magento run Unit Tests,Functional Tests EE,Functional Tests CE ,Functional Tests B2B

@magento-automated-testing
Copy link

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.

@engcom-Echo
Copy link
Contributor

Functional Tests B2B failure is different on last two run on same commit.
Run1
Screenshot 2023-08-25 at 10 14 05 AM

Run2
Screenshot 2023-08-25 at 10 14 11 AM

Hence moving it to Merge In Progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: category of expertise Award: test coverage Component: Catalog Priority: P3 May be fixed according to the position in the backlog. Progress: accept Project: Community Picked PRs upvoted by the community Release Line: 2.4 Risk: low Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
9 participants