Skip to content
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

feat: Allow to configure the parser PHP version #1044

Merged
merged 5 commits into from
Jun 16, 2024

Conversation

theofidry
Copy link
Member

@theofidry theofidry commented Jun 15, 2024

This PR introduces a php-version to the configuration file and as command options for the add-prefix and inspect command (e.g. have --php-version=7.2).

The PHP version provided is used to configure the underlying PHP-Parser Parser and Printer. This will not affect
the PHP internal symbols used by PHP-Scoper (i.e. mb_str_pad will be understood as an internal function, even if the PHP version configured is <8.3). However, this will affect what code can be parsed and how the code will be printed.

If no PHP version is used, the host version will be used, i.e. executing it with PHP 8.4 will
result in PHP 8.4 being used as the PHP version.

This should allow to forcefully fix sebastianbergmann/phpunit#5855.

@theofidry theofidry marked this pull request as ready for review June 16, 2024 14:52
@theofidry theofidry merged commit 226ba7d into humbug:main Jun 16, 2024
126 checks passed
@theofidry theofidry deleted the feat/php-version branch June 16, 2024 15:12
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.

PHP-Scoper 0.18.12 breaks PHAR for PHPUnit 8.5 on PHP 7.2
1 participant