Conversation
WordPress 6.9.4 requires PHP 7.2 or higher; we cannot test against PHP 7.1
n7studios
commented
Apr 7, 2026
| * @var WP_Error|array|bool|null | ||
| */ | ||
| public $resources = array(); | ||
| public $resources; |
Contributor
Author
There was a problem hiding this comment.
This is required for PHPStan static analysis to pass for PHP < 8.0, given the docblock comment supports different types.
noelherrick
approved these changes
Apr 7, 2026
6 tasks
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.
Summary
#109 was included in 2.1.4 of the Kit WordPress Libraries, which resulted in errors (Intercom ticket) on sites running PHP 7.4 or lower:
An error of type E_PARSE was caused in line 147 of the file class-convertkit-api-traits.php. Error message: syntax error, unexpected '|', expecting variable (T_VARIABLE)"This is due to union type declarations only being supported in PHP 8.0 or higher, and said trait file from the Kit PHP SDK only supporting PHP 8 and higher.
Kit Plugin updates were issued to resolve, rolling back the libraries to 2.1.3.
This wasn't caught by end to end or unit tests, as:
wp-coding-standards/wpcsonly checks style (tabs vs spaces, naming conventions etc); not whether the syntax and functions are supported on a specific PHP versionGiven that all Kit WordPress Plugins state a PHP supported version of 7.1 or higher, this PR resolves by:
phpVersion, ensuring it runs code and static analysis against PHP 7.1 and higherIn the future, it would be good to drop support for older PHP versions - but given the number of errors caused, it seems many creators still use outdated PHP versions, and as such removing support doesn't seem feasible at this time.
Testing
Existing tests pass.
Checklist