AI: Remove dead polyfills.php from php-ai-client#11113
AI: Remove dead polyfills.php from php-ai-client#11113gziolo wants to merge 3 commits intoWordPress:trunkfrom
Conversation
Trac ticket: https://core.trac.wordpress.org/ticket/64591 The file is never loaded because the generated autoloader only handles class autoloading, and the four polyfilled functions (`array_is_list`, `str_starts_with`, `str_contains`, `str_ends_with`) are already provided by WordPress Core in `wp-includes/compat.php`. Also updates `installer.sh` to strip the file during future library updates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
| rm -rf "$TARGET_DIR/third-party/$path" | ||
| done | ||
|
|
||
| # Remove polyfills.php — WordPress Core already provides these functions in compat.php. |
There was a problem hiding this comment.
| # Remove polyfills.php — WordPress Core already provides these functions in compat.php. | |
| # Remove polyfills.php — WordPress Core already provides these functions in compat.php, and the file is never loaded by the custom autoloader. |
|
Committed in https://core.trac.wordpress.org/changeset/61786 |
Trac ticket: https://core.trac.wordpress.org/ticket/64591
Summary
src/wp-includes/php-ai-client/src/polyfills.phpwhich is dead code — the generated autoloader only handles class autoloading, so this function-only file is never loadedarray_is_list,str_starts_with,str_contains,str_ends_with) are already provided by WordPress Core inwp-includes/compat.phptools/php-ai-client/installer.shto strip the file during future library updatesFollow-up to #10881 (comment).
🤖 Generated with Claude Code