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

Add PHP-Parser 5 support #1909

Merged
merged 24 commits into from Mar 23, 2024
Merged

Add PHP-Parser 5 support #1909

merged 24 commits into from Mar 23, 2024

Conversation

sidz
Copy link
Member

@sidz sidz commented Jan 8, 2024

Copy link
Member

@theofidry theofidry left a comment

Choose a reason for hiding this comment

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

👍 for the PR. I think however there is a few unrelated changes that could be extracted for clarity.

I am also a bit confused, is the PHP-Parser API changes working on 4.x? In which case we could migrate to it before allowing PHP-Parser 5.x

src/Mutator/Operator/Finally_.php Outdated Show resolved Hide resolved
src/Mutator/Removal/MatchArmRemoval.php Outdated Show resolved Hide resolved
src/Mutator/Removal/MatchArmRemoval.php Outdated Show resolved Hide resolved
src/Mutation/Mutation.php Outdated Show resolved Hide resolved
src/Mutation/Mutation.php Show resolved Hide resolved
@sidz
Copy link
Member Author

sidz commented Jan 14, 2024

I am also a bit confused, is the PHP-Parser API changes working on 4.x?

The main issue in tests: we will have to support 2 sets of tests in some cases. Also it looks like we will have to override Pretty Printer

@sidz sidz force-pushed the add-php-parser-5-support branch 3 times, most recently from db3e7ef to d8843ed Compare January 14, 2024 11:00
@ttomdewit
Copy link

When I try to install with this branch it also signals that it needs to update sebastian/diff to ^6.0.0.

  Problem 2
    - Root composer.json requires infection/infection dev-add-php-parser-5-support@dev -> satisfiable by infection/infection[dev-add-php-parser-5-support].
    - infection/infection dev-add-php-parser-5-support requires sebastian/diff ^3.0.2 || ^4.0 || ^5.0 -> satisfiable by sebastian/diff[3.0.2, 3.0.3, 3.0.4, 4.0.0, ..., 4.0.5, 5.0.0, ..., 5.1.0].
    - You can only install one version of a package, so only one of these can be installed: sebastian/diff[3.0.2, 3.0.3, 3.0.4, 4.0.0, ..., 4.0.5, 5.0.0, ..., 5.1.0, 6.0.0].
    - phpunit/phpunit[11.0.0, ..., 11.0.2] require sebastian/diff ^6.0 -> satisfiable by sebastian/diff[6.0.0].
    - Root composer.json requires phpunit/phpunit ^11.0.0 -> satisfiable by phpunit/phpunit[11.0.0, 11.0.1, 11.0.2].

@sidz
Copy link
Member Author

sidz commented Feb 9, 2024

sebastian/diff released 7 days ago with phpunit 11. As an option you could downgrade phpunit.

also we have openned PR to add support for sebastian/diff: ^6.0 #1913

@ttomdewit
Copy link

sebastian/diff released 7 days ago with phpunit 11. As an option you could downgrade phpunit.

also we have openned PR to add support for sebastian/diff: ^6.0 #1913

Sorry I completely missed that one! I was aiming to get PHPUnit 11 running in my project, hence me trying this branch. Best of luck wrapping up, looking forward to upgrading!

@darthf1
Copy link
Contributor

darthf1 commented Mar 5, 2024

Is this ready now that #1913 is merged? :)

@sidz
Copy link
Member Author

sidz commented Mar 13, 2024

The main issue in tests: we will have to support 2 sets of tests in some cases. Also it looks like we will have to override Pretty Printer

What about dropping support for PHP-Parser 4 in release 0.30? @infection/core

@maks-rafalko
Copy link
Member

maks-rafalko commented Mar 13, 2024

I have to say that I'm not understanding the current issues with tests and pretty printer yet, but I'm completely ok with dropping support for php-parser v4.

In the worst case if some project is stuck with php-parser v4 and want new Infection - infection.phar can be used.

UPD: I think now I understand why we would need to support 2 versions in tests, because pretty printer output has changed. Yeah, let's not do it.

# Conflicts:
#	composer.json
#	composer.lock
#	src/Mutator/IgnoreMutator.php
#	tests/phpunit/Mutant/MutantCodeFactoryTest.php
#	tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php
#	tests/phpunit/Mutator/Boolean/Yield_Test.php
#	tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php
#	tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php
#	tests/phpunit/Mutator/Loop/Foreach_Test.php
#	tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php
#	tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php
#	tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php
#	tests/phpunit/Mutator/ReturnValue/NewObjectTest.php
#	tests/phpunit/Mutator/ReturnValue/YieldValueTest.php
#	tests/phpunit/Mutator/Util/AbstractValueToNullReturnValueTest.php
#	tests/phpunit/PhpParser/FileParserTest.php
#	tests/phpunit/PhpParser/Visitor/MutatorVisitorTest.php
#	tests/phpunit/PhpParser/Visitor/ParentConnectorVisitorTest.php
@maks-rafalko maks-rafalko marked this pull request as ready for review March 23, 2024 17:36
@maks-rafalko
Copy link
Member

@sidz please review 😃

Copy link
Member Author

@sidz sidz left a comment

Choose a reason for hiding this comment

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

@maks-rafalko
Copy link
Member

Thanks for your hard work @sidz, let's merge and release

@maks-rafalko maks-rafalko merged commit 7375c55 into master Mar 23, 2024
55 checks passed
@maks-rafalko maks-rafalko deleted the add-php-parser-5-support branch March 23, 2024 18:40
@maks-rafalko
Copy link
Member

github-merge-queue bot pushed a commit to Lendable/json-serializer that referenced this pull request Mar 23, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [infection/infection](https://togithub.com/infection/infection) |
`^0.27.11` -> `^0.28.0` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/infection%2finfection/0.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/infection%2finfection/0.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/infection%2finfection/0.27.11/0.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/infection%2finfection/0.27.11/0.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>infection/infection (infection/infection)</summary>

###
[`v0.28.0`](https://togithub.com/infection/infection/blob/HEAD/CHANGELOG.md#0280-2024-03-23)

[Compare
Source](https://togithub.com/infection/infection/compare/0.27.11...0.28.0)

[Full
Changelog](https://togithub.com/infection/infection/compare/0.27.11...0.28.0)

**Added:**

- Add PHP-Parser 5 support by [@&#8203;sidz](https://togithub.com/sidz)
in
[infection/infection#1909

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/Lendable/json-serializer).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI2MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

Clean project ApiPlatform + PhpUnit 11 + PHP 8.3.x -> nikic/php-parser minimum version bump needed
5 participants