Skip to content

Update PHPStan 2.2.13 - #13410

Open
staabm wants to merge 1 commit into
WordPress:trunkfrom
staabm:upstan
Open

Update PHPStan 2.2.13#13410
staabm wants to merge 1 commit into
WordPress:trunkfrom
staabm:upstan

Conversation

@staabm

@staabm staabm commented Sep 5, 2026

Copy link
Copy Markdown

at PHPStan we worked hard to improve performance on recent releases. Updating the tooling makes sure Wordpress can use latest additions and get the best possible PHPStan experience

before this PR (PHPStan 2.2.5)

time composer phpstan
197.13s user 10.28s system 667% cpu 31.084 total

after this PR (PHPStan 2.2.13)

time composer phpstan
112.30s user 5.09s system 981% cpu 11.964 total

running on Macbook M4-Pro, PHP 8.5.10 (cli)

=> ~20 seconds faster (wall-time; cold result-cache)

https://core.trac.wordpress.org/ticket/66051

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props markusstaab.

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

$safe_text = (string) preg_replace_callback(
$regex,
static function ( $matches ) {
if ( ! isset( $matches[0] ) ) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

fixes

  4851   Call to function array_key_exists() with 0 and array{0: string, non_cdata_followed_by_cdata: '', 1: '', 2: '', cdata: '', 3: '', 4: '', non_cdata: string, ...}|array{0:  
         string, non_cdata_followed_by_cdata: string, 1: string, 2: string, cdata: non-falsy-string, 3: non-falsy-string, 4: non-falsy-string} will always evaluate to true.       
         🪪  function.alreadyNarrowedType                                                                                                                                          
         at src/wp-includes/formatting.php:4851                                                                                                                                    

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@staabm

staabm commented Sep 5, 2026

Copy link
Copy Markdown
Author

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

done

count: 2
path: ../../../src/wp-includes/class-wp-embed.php
-
message: '#^Parameter \#1 \$handle of function curl_getinfo expects resource, \(resource\|false\) given\.$#'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Will be fixed upstream with phpstan/phpstan#15185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant