Make WordPress Core

Changeset 64012


Ignore:
Timestamp:
09/30/2026 02:33:44 AM (11 days ago)
Author:
westonruter
Message:

Build/Test Tools: Update PHPStan to 2.2.16.

The 2.2.15 and 2.2.16 releases carry many type-inference fixes along with updated PHP 8 stubs. The baselines are regenerated for the new version, with five entries dropping out and one being reworded.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13809.
Follow-up to r63510, r63787.

Props mukesh27.
See #65817.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/composer.json

    r63787 r64012  
    5353                "wp-coding-standards/wpcs": "~3.4.1",
    5454                "phpcompatibility/phpcompatibility-wp": "~2.1.3",
    55                 "phpstan/phpstan": "2.2.14",
     55                "phpstan/phpstan": "2.2.16",
    5656                "phpstan/phpstan-phpunit": "2.0.18",
    5757                "yoast/phpunit-polyfills": "^1.1.0"
  • trunk/tests/phpstan/baselines/argument.type.neon

    r63941 r64012  
    775775                        path: ../../../src/wp-includes/class-wp-embed.php
    776776                -
    777                         message: '#^Parameter \#1 \$handle of function curl_getinfo expects resource, \(resource\|false\) given\.$#'
    778                         identifier: argument.type
    779                         count: 2
     777                        message: '#^Parameter \#3 \$value of function curl_setopt expects int, string given\.$#'
     778                        identifier: argument.type
     779                        count: 1
    780780                        path: ../../../src/wp-includes/class-wp-http-curl.php
    781781                -
    782                         message: '#^Parameter \#3 \$value of function curl_setopt expects int, string given\.$#'
    783                         identifier: argument.type
    784                         count: 1
    785                         path: ../../../src/wp-includes/class-wp-http-curl.php
    786                 -
    787782                        message: '#^Parameter \#2 \$mode of function stream_set_blocking expects bool, int given\.$#'
    788783                        identifier: argument.type
    … …  
    934929                        count: 1
    935930                        path: ../../../src/wp-includes/formatting.php
    936                 -
    937                         message: '#^Parameter \#1 \$finfo of function finfo_file expects resource, resource\|false given\.$#'
    938                         identifier: argument.type
    939                         count: 2
    940                         path: ../../../src/wp-includes/functions.php
    941931                -
    942932                        message: '#^Parameter \#1 \$prefix of function uniqid expects string, int\<0, max\> given\.$#'
  • trunk/tests/phpstan/baselines/function.alreadyNarrowedType.neon

    r63510 r64012  
    7070                        path: ../../../src/wp-includes/functions.php
    7171                -
    72                         message: '#^Call to function is_scalar\(\) with int\|string will always evaluate to true\.$#'
    73                         identifier: function.alreadyNarrowedType
    74                         count: 3
    75                         path: ../../../src/wp-includes/functions.php
    76                 -
    7772                        message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#'
    7873                        identifier: function.alreadyNarrowedType
    … …  
    9590                        path: ../../../src/wp-includes/ms-functions.php
    9691                -
    97                         message: '#^Call to function is_array\(\) with array\{non\-falsy\-string, non\-falsy\-string&numeric\-string, numeric\-string, numeric\-string\} will always evaluate to true\.$#'
     92                        message: '#^Call to function is_array\(\) with non\-empty\-array\<string\> will always evaluate to true\.$#'
    9893                        identifier: function.alreadyNarrowedType
    9994                        count: 1
  • trunk/tests/phpstan/baselines/function.impossibleType.neon

    r63023 r64012  
    3030                        path: ../../../src/wp-admin/update.php
    3131                -
    32                         message: '#^Call to function is_wp_error\(\) with array will always evaluate to false\.$#'
    33                         identifier: function.impossibleType
    34                         count: 2
    35                         path: ../../../src/wp-includes/class-wp-tax-query.php
    36                 -
    3732                        message: '#^Call to function is_string\(\) with bool will always evaluate to false\.$#'
    3833                        identifier: function.impossibleType
  • trunk/tests/phpstan/baselines/isset.offset.neon

    r63023 r64012  
    3030                        path: ../../../src/wp-includes/functions.php
    3131                -
    32                         message: '#^Offset 2 on array\{string, non\-empty\-string, non\-empty\-string\} in isset\(\) always exists and is not nullable\.$#'
    33                         identifier: isset.offset
    34                         count: 1
    35                         path: ../../../src/wp-includes/media.php
    36                 -
    3732                        message: '#^Offset ''orderby'' on array\{post_parent\: mixed, post_type\: ''revision'', post_status\: ''inherit'', posts_per_page\: mixed, orderby\: mixed, order\: mixed, suppress_filters\: true, post__not_in\?\: mixed, \.\.\.\} in isset\(\) always exists and is not nullable\.$#'
    3833                        identifier: isset.offset
Note: See TracChangeset for help on using the changeset viewer.