Closed
Conversation
Contributor
|
@sol-loup has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
mradmeta
pushed a commit
that referenced
this pull request
Apr 19, 2025
Summary: ## Description This pull request addresses code quality and linting issues in the `AdminMessageHandler` class. The main changes include: - Replacing all instances of `sizeof()` with `count()` for array size checks. - Fixing docblock formatting and capitalization. - Replacing logical operator `or` with `||`. - Expanding inline control structures to full statements. - Improving multi-line function call formatting. - Adding a PHPCS ignore comment for the unused `$_status` parameter in the `redirect` method. These changes are non-breaking and focus solely on code clarity, maintainability, and compliance with coding standards. ### Type of change - Syntax change (non-breaking change which fixes code modularity, linting or phpcs issues) ## Checklist - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have confirmed that my changes do not introduce any new PHPCS warnings or errors. - [x] I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors. - [x] I followed general Pull Request best practices. - [x] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes. - [x] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality. - [x] I have updated or requested update to plugin documentations (if necessary). ## Changelog entry Refactor: Replace `sizeof()` with `count()` and fix PHPCS/linting issues in AdminMessageHandler. Pull Request resolved: #3068 Test Plan: 1. **Automated Tests**: Run all existing unit and integration tests to ensure no regressions. 2. **Manual QA**: - Trigger admin messages, warnings, errors, and info notices in the WordPress admin. - Confirm that all messages display as expected. - Perform actions that cause redirects and verify that messages persist across requests. - Check that no new PHP warnings, errors, or PHPCS issues are introduced. 3. **Code Review**: Ensure all changes are limited to syntax and style, with no logic or behavioral changes. ## Screenshots N/A (no UI changes) **!---- (auto-generated) DO NOT EDIT OR PUT ANYTHING AFTER THIS LINE ----!** MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: www / Diff Version V1 https://internalfb.com/intern/testinfra/testrun/7036874680167270 MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: bloks / Diff Version V1 https://internalfb.com/intern/testinfra/testrun/14636698867856809 Reviewed By: carterbuce Differential Revision: D73227487 Pulled By: sol-loup fbshipit-source-id: 18067b7913e273b3298fd878f4b65fa8a7d5600d
mradmeta
pushed a commit
to mradmeta/facebook-for-woocommerce
that referenced
this pull request
Apr 22, 2025
Summary: ## Description This pull request addresses code quality and linting issues in the `AdminMessageHandler` class. The main changes include: - Replacing all instances of `sizeof()` with `count()` for array size checks. - Fixing docblock formatting and capitalization. - Replacing logical operator `or` with `||`. - Expanding inline control structures to full statements. - Improving multi-line function call formatting. - Adding a PHPCS ignore comment for the unused `$_status` parameter in the `redirect` method. These changes are non-breaking and focus solely on code clarity, maintainability, and compliance with coding standards. ### Type of change - Syntax change (non-breaking change which fixes code modularity, linting or phpcs issues) ## Checklist - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have confirmed that my changes do not introduce any new PHPCS warnings or errors. - [x] I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors. - [x] I followed general Pull Request best practices. - [x] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes. - [x] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality. - [x] I have updated or requested update to plugin documentations (if necessary). ## Changelog entry Refactor: Replace `sizeof()` with `count()` and fix PHPCS/linting issues in AdminMessageHandler. Pull Request resolved: facebook#3068 Test Plan: 1. **Automated Tests**: Run all existing unit and integration tests to ensure no regressions. 2. **Manual QA**: - Trigger admin messages, warnings, errors, and info notices in the WordPress admin. - Confirm that all messages display as expected. - Perform actions that cause redirects and verify that messages persist across requests. - Check that no new PHP warnings, errors, or PHPCS issues are introduced. 3. **Code Review**: Ensure all changes are limited to syntax and style, with no logic or behavioral changes. ## Screenshots N/A (no UI changes) **!---- (auto-generated) DO NOT EDIT OR PUT ANYTHING AFTER THIS LINE ----!** MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: www / Diff Version V1 https://internalfb.com/intern/testinfra/testrun/7036874680167270 MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: bloks / Diff Version V1 https://internalfb.com/intern/testinfra/testrun/14636698867856809 Reviewed By: carterbuce Differential Revision: D73227487 Pulled By: sol-loup fbshipit-source-id: 18067b7913e273b3298fd878f4b65fa8a7d5600d
This was referenced Apr 23, 2025
This was referenced May 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request addresses code quality and linting issues in the
AdminMessageHandlerclass. The main changes include:sizeof()withcount()for array size checks.orwith||.$_statusparameter in theredirectmethod.These changes are non-breaking and focus solely on code clarity, maintainability, and compliance with coding standards.
Type of change
Checklist
Changelog entry
Refactor: Replace
sizeof()withcount()and fix PHPCS/linting issues in AdminMessageHandler.Test Plan
Screenshots
N/A (no UI changes)