Skip to content

Bump nikic/php-parser to 5.4.0 #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged

Conversation

IanDelMar
Copy link
Contributor

@IanDelMar IanDelMar commented Apr 18, 2025

This PR updates nikic/php-parser from ^4.13 to ^5.4.

I reviewed the diff and found no unwanted changes resulting from the upgrade. The changes introduced by this PR result from changes in pretty-printing behavior in php-parser v5:

  • Return types are now printed without a space before the colon (:).
  • The abstract and final modifiers are now printed before visibility modifiers. Example: public finalfinal public.
  • Backslashes in single-quoted strings are now escaped only when necessary. Examples: [\\d][\d], \\.\., 'SimplePie\\Cache\\MySQL''SimplePie\Cache\MySQL'.

In fact, php-parser v5 reverts changes introduced in version 4. For example:

// WP core:
final public function set_header_image( $choice ) {
    // ...
}

// Stub with nikic/php-parser v4:
public final function set_header_image($choice)
{
}

// Stub with nikic/php-parser v5:
final public function set_header_image($choice)
{
}

Related: php-stubs/generator#33

@IanDelMar IanDelMar changed the title Bump nikic/php-parser Bump nikic/php-parser to 5.4.0 Apr 18, 2025
@szepeviktor
Copy link
Member

szepeviktor commented Apr 18, 2025

So much change!
Who will fix it? 🙃

@szepeviktor szepeviktor merged commit 66b4a69 into php-stubs:master Apr 18, 2025
6 checks passed
@IanDelMar
Copy link
Contributor Author

Fix what?

@szepeviktor
Copy link
Member

There was hundreds of changes.
I cannot tell whether they are okay.

@IanDelMar
Copy link
Contributor Author

Sorry for the initially sparse — or missing, respectively — PR description. I’ve added it now. I’ll try to provide better context upfront in future PRs!

@IanDelMar IanDelMar deleted the bump-parser branch April 18, 2025 14:52
@szepeviktor
Copy link
Member

I reviewed the diff and found no unwanted changes resulting from the upgrade. The changes introduced by this PR result from changes in pretty-printing behavior in php-parser v5:

Thank you!

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.

2 participants