Skip to content

Support PHP 7.2 and nikic/php-parser 4 - #21

Merged
oscarotero merged 1 commit into
php-gettext:masterfrom
swissspidy:php-7.2
Nov 20, 2026
Merged

oscarotero merged 1 commit into
php-gettext:masterfrom
swissspidy:php-7.2

Conversation

@swissspidy

Copy link
Copy Markdown
Contributor

gettext/gettext 5 supports PHP 7.2, but the scanner needed PHP 7.4 because of typed properties and nikic/php-parser 5.

  • Allow nikic/php-parser ^4.18 next to ^5 and create the parser and traverser in a way that works with both.
  • Handle the scalar node names of nikic/php-parser 4.
  • Skip duplicate comments. nikic/php-parser 4 assigns a comment to every node starting after it, not only to the outermost one.
  • Replace typed properties with docblocks.
  • Allow PHPUnit 8.5 and run the tests on PHP 7.2 and 7.3.

This will be helpful for the migration to v5 in WP-CLI.

Claude-Session: https://claude.ai/code/session_01UWTd5qmztfFv37ybV4xsjV

@swissspidy
swissspidy marked this pull request as ready for review November 17, 2026 16:15
Copilot AI balanced review requested due to automatic review settings November 17, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

`gettext/gettext` 5 supports PHP 7.2, but the scanner needed PHP 7.4
because of typed properties and nikic/php-parser 5.

* Allow nikic/php-parser ^4.18 next to ^5 and create the parser and
  traverser in a way that works with both.
* Handle the scalar node names of nikic/php-parser 4.
* Skip duplicate comments. nikic/php-parser 4 assigns a comment to
  every node starting after it, not only to the outermost one.
* Replace typed properties with docblocks.
* Allow PHPUnit 8.5 and run the tests on PHP 7.2 and 7.3.
@oscarotero
oscarotero merged commit 41aef9e into php-gettext:master Nov 20, 2026
8 checks passed
@oscarotero

Copy link
Copy Markdown
Member

Thank you

@swissspidy
swissspidy deleted the php-7.2 branch November 23, 2026 16:43
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.

3 participants