Skip to content

Conversation

@westonruter
Copy link
Member

In #1130 the PHP version was bumped to 7.2. This allows us to make use of new PHP language features which further harden static analysis (related to #775). Changes in this PR include:

  • Use the void return type
  • Use the nullable type
  • Add value types for arrays
  • Add improved typing to prevent having to ignore the following errors in PHPStan level 6:
    • #^(Function|Method) .+? return type has no value type specified in iterable type array#
    • #^(Function|Method) .+? has parameter .+? with no value type specified in iterable type array#
    • #^(Function|Method) .+? has no return type specified#

@westonruter westonruter added [Type] Enhancement A suggestion for improvement of an existing feature [Plugin] Optimization Detective Issues for the Optimization Detective plugin labels Apr 18, 2024
@westonruter westonruter requested a review from felixarntz as a code owner April 18, 2024 20:06
@github-actions
Copy link

github-actions bot commented Apr 18, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <[email protected]>
Co-authored-by: thelovekesh <[email protected]>
Co-authored-by: joemcgill <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one suggestion, but looks good. Pre-approving.

* @link https://core.trac.wordpress.org/ticket/43258
*
* @param string $passthrough Optional. Filter value. Default null.
* @param string $passthrough Value for the template_include filter which is passed through.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch ✨

@westonruter westonruter merged commit 181cf6f into trunk Apr 19, 2024
@westonruter westonruter deleted the update/od-php72-features branch April 19, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants