-
Couldn't load subscription status.
- Fork 10
PHP 8.4 Compatibility #413
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
Draft
peterwilsoncc
wants to merge
12
commits into
trunk
Choose a base branch
from
fix/SQUARE-197-php84-compat
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5a50eaa
Modify PHP Compat workflow to include production dependencies.
peterwilsoncc 4600951
Explicitly mark parameters as nullable.
peterwilsoncc 1ccfd5a
Run sniffs against production files.
peterwilsoncc 5d96eeb
Move the file for unzipping.
peterwilsoncc 7fb4b1b
Change in to correct directory.
peterwilsoncc 35c4101
Set basepath for report clarity.
peterwilsoncc 6635577
Do not declare option param prior to required param.
peterwilsoncc 9d20b8b
Define flags for html_entity_decode() using PHP 8.1+ defaults.
peterwilsoncc d9afb02
Define flags for htmlspecialchars() using PHP 8.1+ defaults.
peterwilsoncc 9f6da32
Replace deprecated `FILTER_SANITIZE_STRING` with stripping tags and H…
peterwilsoncc 48007e1
Exclude vendor tests, docs and dot files from distribution.
peterwilsoncc 8f3fafe
Update ‘PHP tested up to’ header.
peterwilsoncc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,65 @@ | ||
| <?xml version="1.0"?> | ||
| <ruleset name="PHPCompatibilityWP"> | ||
| <rule ref="PHPCompatibility"/> | ||
| <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHPCompatibilityWP" xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd"> | ||
|
|
||
| <!-- Files to check --> | ||
| <arg name="extensions" value="php"/> | ||
| <file>.</file> | ||
| <description>WordPress specific ruleset which checks for PHP cross version compatibility.</description> | ||
| <!-- Once PHPCompatibility/PHPCompatibilityWP supports the targeted versions of PHP, this config file can be updated accordingly. --> | ||
|
|
||
| <exclude-pattern>vendor/</exclude-pattern> | ||
| <exclude-pattern>dist/</exclude-pattern> | ||
| <exclude-pattern>docker/</exclude-pattern> | ||
| <exclude-pattern>build/</exclude-pattern> | ||
| <exclude-pattern>docs/</exclude-pattern> | ||
| <exclude-pattern>node_modules</exclude-pattern> | ||
| <exclude-pattern>tests</exclude-pattern> | ||
| <exclude-pattern>assets</exclude-pattern> | ||
| <!-- Test PHP 7.4 thru 8.4 --> | ||
| <config name="testVersion" value="7.4-8.4"/> | ||
| <file>.</file> | ||
| <arg name="extensions" value="php,inc" /> | ||
|
|
||
| <rule ref="PHPCompatibility"> | ||
| <!-- | ||
| Contained in /wp-includes/compat.php. | ||
|
|
||
| History of the polyfills in WP: | ||
| * hash_hmac(): since WP 3.2.0. | ||
| * json_encode() and json_decode(): since unknown. | ||
| * hash_equals(): since WP 3.9.2. | ||
| * JSON_PRETTY_PRINT: since WP 4.1.0. | ||
| * json_last_error_msg(): since WP 4.4.0. | ||
| * JsonSerializable: since WP 4.4.0. | ||
| * array_replace_recursive(): since WP 4.5.3 up to 5.2.x. The polyfill was removed in WP 5.3. | ||
| * is_iterable(): since WP 4.9.6 | ||
| * is_countable(): since WP 4.9.6 | ||
| * IMAGETYPE_WEBP and IMG_WEBP: since WP 5.8.0. | ||
| * array_key_first(): since WP 5.9.0 | ||
| * array_key_last(): since WP 5.9.0 | ||
| * str_contains(): since WP 5.9.0 | ||
| * str_starts_with(): since WP 5.9.0 | ||
| * str_ends_with(): since WP 5.9.0 | ||
| * array_is_list(): since WP 6.5.0 | ||
| --> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.hash_hmacFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_encodeFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_decodeFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.hash_equalsFound"/> | ||
| <exclude name="PHPCompatibility.Constants.NewConstants.json_pretty_printFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_last_error_msgFound"/> | ||
| <exclude name="PHPCompatibility.Interfaces.NewInterfaces.jsonserializableFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_replace_recursiveFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.is_iterableFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.is_countableFound"/> | ||
| <exclude name="PHPCompatibility.Constants.NewConstants.imagetype_webpFound"/> | ||
| <exclude name="PHPCompatibility.Constants.NewConstants.img_webpFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_key_firstFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_key_lastFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_containsFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_starts_withFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_is_listFound"/> | ||
|
|
||
| <!-- | ||
| Contained in /wp-includes/spl-autoload-compat.php. | ||
|
|
||
| History of the polyfills in WP: | ||
| * spl_autoload_register(), spl_autoload_unregister() and spl_autoload_functions() were | ||
| introduced in WP 4.6.0 and available up to WP 5.2.x. The polyfills were removed in WP 5.3. | ||
| --> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.spl_autoload_registerFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.spl_autoload_unregisterFound"/> | ||
| <exclude name="PHPCompatibility.FunctionUse.NewFunctions.spl_autoload_functionsFound"/> | ||
| </rule> | ||
|
|
||
| <config name="testVersion" value="7.4-"/> | ||
| </ruleset> |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Various unit tests and dot files that have no place in production.
A couple of them were throwing errors in the php-compat sniffs but I figured we could remove them as they never run in our code base.