Skip to content

Conversation

@westonruter
Copy link
Member

@westonruter westonruter commented Dec 22, 2025

This is a subset of #10627

This PR addresses the following issues PHPStan level 8 issues:

phpstan analyze --memory-limit=4G --level=8 src/wp-includes/functions.wp-styles.php src/wp-includes/functions.wp-scripts.php

Before:

Note: Using configuration file /Users/westonruter/repos/wordpress-develop/phpstan.neon.
 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ --------------------------------------------------------------------------------------------------------
  Line   functions.wp-scripts.php
 ------ --------------------------------------------------------------------------------------------------------
  144    Parameter #1 $string of function trim expects string, string|null given.
         🪪  argument.type
  181    Function wp_register_script() has parameter $args with no value type specified in iterable type array.
         🪪  missingType.iterableValue
         💡  See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
  230    Function wp_localize_script() has parameter $l10n with no value type specified in iterable type array.
         🪪  missingType.iterableValue
         💡  See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
  366    Function wp_enqueue_script() has parameter $args with no value type specified in iterable type array.
         🪪  missingType.iterableValue
         💡  See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
 ------ --------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------------------------------
  Line   functions.wp-styles.php
 ------ ------------------------------------------------------------------------------------------------------------------------------------
  44     Function wp_print_styles() has parameter $handles with no value type specified in iterable type array.
         🪪  missingType.iterableValue
         💡  See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
  68     Parameter #1 $handles of method WP_Dependencies::do_items() expects array<string>|string|false, array|bool|non-empty-string given.
         🪪  argument.type
  101    Parameter #1 $string of function trim expects string, string|null given.
         🪪  argument.type
 ------ ------------------------------------------------------------------------------------------------------------------------------------

After:

[OK] No errors

Trac ticket: https://core.trac.wordpress.org/ticket/64238


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link

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 westonruter.

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

pento pushed a commit that referenced this pull request Dec 22, 2025
…and `functions.wp-styles.php`.

These files now adhere to PHPStan level 8.

Developed in #10652

Follow-up to [61362], [61358].

See #64238.


git-svn-id: https://develop.svn.wordpress.org/trunk@61402 602fd350-edb4-49c9-b593-d223f7449a82
@westonruter
Copy link
Member Author

Committed in r61402

markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Dec 22, 2025
…and `functions.wp-styles.php`.

These files now adhere to PHPStan level 8.

Developed in WordPress/wordpress-develop#10652

Follow-up to [61362], [61358].

See #64238.

Built from https://develop.svn.wordpress.org/trunk@61402


git-svn-id: http://core.svn.wordpress.org/trunk@60714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot pushed a commit to platformsh/wordpress-performance that referenced this pull request Dec 22, 2025
…and `functions.wp-styles.php`.

These files now adhere to PHPStan level 8.

Developed in WordPress/wordpress-develop#10652

Follow-up to [61362], [61358].

See #64238.

Built from https://develop.svn.wordpress.org/trunk@61402


git-svn-id: https://core.svn.wordpress.org/trunk@60714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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