Changeset 61699
- Timestamp:
- 02/20/2026 02:24:12 AM (2 weeks ago)
- Location:
- trunk
- Files:
-
- 8 added
- 15 edited
-
. (modified) (1 prop)
-
.github/workflows/phpstan-static-analysis.yml (added)
-
.github/workflows/reusable-phpstan-static-analysis.yml (added)
-
.gitignore (modified) (1 diff)
-
Gruntfile.js (modified) (2 diffs)
-
composer.json (modified) (2 diffs)
-
package.json (modified) (1 diff)
-
phpcs.xml.dist (modified) (1 diff)
-
phpstan.neon.dist (added)
-
src/wp-admin/includes/class-wp-filesystem-ssh2.php (modified) (1 diff)
-
src/wp-admin/press-this.php (modified) (1 diff)
-
src/wp-includes/class-wp-scripts.php (modified) (1 diff)
-
src/wp-includes/class-wp-theme-json.php (modified) (2 diffs)
-
src/wp-includes/functions.php (modified) (1 diff)
-
src/wp-includes/html-api/class-wp-html-processor.php (modified) (2 diffs)
-
src/wp-includes/media.php (modified) (1 diff)
-
src/wp-includes/style-engine/class-wp-style-engine-css-rules-store.php (modified) (1 diff)
-
src/wp-includes/template.php (modified) (2 diffs)
-
tests/phpstan (added)
-
tests/phpstan/README.md (added)
-
tests/phpstan/base.neon (added)
-
tests/phpstan/baseline.php (added)
-
tests/phpstan/bootstrap.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 11 11 wp-cli.local.yml 12 12 .git 13 phpstan.neon 13 14 jsdoc 14 15 composer.lock
-
- Property svn:ignore
-
trunk/.gitignore
r61674 r61699 24 24 /tests/phpunit/build 25 25 /wp-cli.local.yml 26 /phpstan.neon 26 27 /jsdoc 27 28 /composer.lock -
trunk/Gruntfile.js
r61669 r61699 1561 1561 1562 1562 grunt.registerTask( 'precommit:php', [ 1563 'phpstan', 1563 1564 'phpunit' 1564 1565 ] ); … … 2002 2003 grunt.registerTask( 'test', 'Runs all QUnit and PHPUnit tasks.', ['qunit:compiled', 'phpunit'] ); 2003 2004 2005 grunt.registerTask( 'phpstan', 'Runs PHPStan on the entire codebase.', function() { 2006 var done = this.async(); 2007 2008 grunt.util.spawn( { 2009 cmd: 'composer', 2010 args: [ 'phpstan' ], 2011 opts: { stdio: 'inherit' } 2012 }, function( error ) { 2013 done( ! error ); 2014 } ); 2015 } ); 2016 2004 2017 grunt.registerTask( 'format:php', 'Runs the code formatter on changed files.', function() { 2005 2018 var done = this.async(); -
trunk/composer.json
r61685 r61699 24 24 "wp-coding-standards/wpcs": "~3.3.0", 25 25 "phpcompatibility/phpcompatibility-wp": "~2.1.3", 26 "phpstan/phpstan": "2.1.39", 26 27 "yoast/phpunit-polyfills": "^1.1.0" 27 28 }, … … 33 34 }, 34 35 "scripts": { 36 "phpstan": "@php ./vendor/bin/phpstan analyse --memory-limit=2G", 35 37 "compat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcompat.xml.dist --report=summary,source", 36 38 "format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source", -
trunk/package.json
r61686 r61699 131 131 "test:e2e": "wp-scripts test-playwright --config tests/e2e/playwright.config.js", 132 132 "test:visual": "wp-scripts test-playwright --config tests/visual-regression/playwright.config.js", 133 "typecheck:php": "node ./tools/local-env/scripts/docker.js run --rm php composer phpstan", 133 134 "gutenberg:checkout": "node tools/gutenberg/checkout-gutenberg.js", 134 135 "gutenberg:build": "node tools/gutenberg/build-gutenberg.js", -
trunk/phpcs.xml.dist
r60939 r61699 81 81 <exclude-pattern>/tests/phpunit/build*</exclude-pattern> 82 82 <exclude-pattern>/tests/phpunit/data/*</exclude-pattern> 83 84 <!-- PHPStan bootstrap, stubs, and baseline. --> 85 <exclude-pattern>/tests/phpstan/*</exclude-pattern> 83 86 84 87 <exclude-pattern>/tools/*</exclude-pattern> -
trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php
r57644 r61699 671 671 * @param int $atime Optional. Access time to set for file. 672 672 * Default 0. 673 * @return false Always returns false because not implemented. 673 674 */ 674 675 public function touch( $file, $time = 0, $atime = 0 ) { 675 676 // Not implemented. 677 return false; 676 678 } 677 679 -
trunk/src/wp-admin/press-this.php
r61030 r61699 23 23 ); 24 24 } elseif ( is_plugin_active( $plugin_file ) ) { 25 include WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php'; 26 $wp_press_this = new WP_Press_This_Plugin(); 25 include WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php'; // @phpstan-ignore include.fileNotFound 26 $wp_press_this = new WP_Press_This_Plugin(); // @phpstan-ignore class.notFound 27 27 $wp_press_this->html(); 28 28 } elseif ( current_user_can( 'activate_plugins' ) ) { -
trunk/src/wp-includes/class-wp-scripts.php
r61587 r61699 1187 1187 } 1188 1188 } 1189 $stored_results[ $handle ] = $priorities[ $highest_priority_index ]; // @phpstan-ignore parameterByRef.type (We know the index is valid and that this will be a string.)1189 $stored_results[ $handle ] = $priorities[ $highest_priority_index ]; 1190 1190 return $priorities[ $highest_priority_index ]; 1191 1191 } -
trunk/src/wp-includes/class-wp-theme-json.php
r61678 r61699 3543 3543 * @param array $path Path to inspect. 3544 3544 * @param bool|array $override Data to compute whether to override the preset. 3545 * @return bool 3545 * @return bool|null True if the preset should override the defaults, false if not. Null if the override parameter is invalid. 3546 3546 */ 3547 3547 protected static function should_override_preset( $theme_json, $path, $override ) { … … 3578 3578 return true; 3579 3579 } 3580 3581 return null; 3580 3582 } 3581 3583 -
trunk/src/wp-includes/functions.php
r61692 r61699 3766 3766 * @type bool $exit Whether to exit the process after completion. Default true. 3767 3767 * } 3768 * @return never|void Returns void if `$args['exit']` is false, otherwise exits. 3769 * 3770 * @phpstan-return ( $args['exit'] is false ? void : never ) 3768 3771 */ 3769 3772 function wp_die( $message = '', $title = '', $args = array() ) { -
trunk/src/wp-includes/html-api/class-wp-html-processor.php
r60919 r61699 140 140 * @see WP_HTML_Tag_Processor 141 141 * @see https://html.spec.whatwg.org/ 142 * @phpstan-consistent-constructor 142 143 */ 143 144 class WP_HTML_Processor extends WP_HTML_Tag_Processor { … … 584 585 * 585 586 * @param string $message Explains support is missing in order to parse the current node. 587 * @return never 586 588 */ 587 589 private function bail( string $message ) { -
trunk/src/wp-includes/media.php
r61501 r61699 4117 4117 */ 4118 4118 function is_gd_image( $image ) { 4119 if ( $image instanceof GdImage 4119 if ( $image instanceof GdImage // @phpstan-ignore class.notFound (Only available with PHP8+.) 4120 4120 || is_resource( $image ) && 'gd' === get_resource_type( $image ) 4121 4121 ) { -
trunk/src/wp-includes/style-engine/class-wp-style-engine-css-rules-store.php
r58089 r61699 14 14 * 15 15 * @since 6.1.0 16 * 17 * @phpstan-consistent-constructor 16 18 */ 17 19 #[AllowDynamicProperties] -
trunk/src/wp-includes/template.php
r61139 r61699 797 797 798 798 if ( isset( $s ) ) { 799 $s = esc_attr( $s ); 799 $s = esc_attr( $s ); // @phpstan-ignore variable.undefined (It's extracted from query vars.) 800 800 } 801 801 … … 977 977 978 978 // Display a caught exception as an error since it prevents any of the output buffer filters from applying. 979 if ( $did_just_catch ) { // @phpstan-ignore if.alwaysFalse (The variable is set in the catch block below.)979 if ( $did_just_catch ) { 980 980 $level = E_USER_ERROR; 981 981 }
Note: See TracChangeset
for help on using the changeset viewer.