Skip to content

Bump nikic/php-parser to 5.4.0 - #283

Merged
szepeviktor merged 1 commit into
php-stubs:masterfrom
IanDelMar:bump-parser
Apr 18, 2025
Merged

Bump nikic/php-parser to 5.4.0#283
szepeviktor merged 1 commit into
php-stubs:masterfrom
IanDelMar:bump-parser

Conversation

@IanDelMar

@IanDelMar IanDelMar commented Apr 18, 2025

Copy link
Copy Markdown
Contributor

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

szepeviktor commented Apr 18, 2025

Copy link
Copy Markdown
Member

So much change!
Who will fix it? 🙃

@szepeviktor
szepeviktor merged commit 66b4a69 into php-stubs:master Apr 18, 2025
@IanDelMar

Copy link
Copy Markdown
Contributor Author

Fix what?

@szepeviktor

Copy link
Copy Markdown
Member

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

@IanDelMar

Copy link
Copy Markdown
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
Copy Markdown
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