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

Update nikic/php-parser from ^4 to ^5 #38

Merged
merged 3 commits into from
Sep 3, 2024

Conversation

msievenpiper
Copy link
Contributor

More recent versions of phpunit require version 5 of php-parser for coverage reporting and other mechanisms within the phpunit framework. As a result the current version of ^4 conflicts with phpunit ^11.
This commit updates the minimum required PHP version from 7.3 to 7.4 following updates in php-parser in version 5, this will make this a breaking change for those on impacted php versions.

On MacOS the tempnam() method call prepends a "private/" to the virtual file location and caused unlinking issues to occur, I have gotten around this by checking if the path string contains rather than matching directly.

nikic/php-parser no longer supports ParserFactory::create() calls and I have changed this to the new recommended ::createForHostVersion() method for continued support inline with the old ParserFactory::PREFER_PHP7 approach.

Following the updates some of the unit test snapshots now contain slightly modified outputs which when verified I have updated accordingly.

dependabot bot and others added 2 commits June 24, 2024 05:27
Updates the requirements on [nikic/php-parser](https://github.com/nikic/PHP-Parser) to permit the latest version.
- [Release notes](https://github.com/nikic/PHP-Parser/releases)
- [Changelog](https://github.com/nikic/PHP-Parser/blob/master/CHANGELOG.md)
- [Commits](nikic/PHP-Parser@v4.10.0...v5.0.2)

---
updated-dependencies:
- dependency-name: nikic/php-parser
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
 - update composer reqs
 - fix virtualfile on macos
 - remove 7.3 from workflow
 - update unit test snapshots
Copy link

what-the-diff bot commented Jul 9, 2024

PR Summary

  • Update to PHP Version in GitHub Workflows and Composer
    This change updates the PHP version used in our GitHub workflows and Composer. This ensures our processes are using a more recent, stable version of PHP which helps enhance security, speed, and compatibility.

  • Incorporating PhpParser in the Searcher
    The PhpParser library is now used within the Searcher module. This modification aids in parsing PHP code in a more efficient and reliable way, making the searching operation more powerful and accurate.

  • Adjustment to unlink Method Condition in VirtualFile
    The condition inside the unlink method of of VirtualFile module has been revised. This may improve how files are handled and aid in avoiding potential errors or conflicts.

  • Updates to SearcherTest
    Two of our automated test files for the Searcher (SearcherTest__it_can_handle_chained_static_and_regular_calls__1.yml and SearcherTest__it_searches_for_var_assignments__1.yml) underwent changes. These adjustments improve our testing capabilities by ensuring that they accurately assess the workability of recently adjusted features.

@patinthehat patinthehat merged commit c95285d into permafrost-dev:main Sep 3, 2024
1 check passed
@patinthehat
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants