Update nikic/php-parser from ^4 to ^5
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.
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
unlinkMethod Condition in VirtualFile The condition inside theunlinkmethod 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.ymlandSearcherTest__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.
Thanks!