Replace symplify/git-wrapper with gitonomy/gitlib for PHP 8.4 compatibility
| Q | A |
|---|---|
| Is bugfix? | ✔️ |
| New feature? | ❌ |
| Breaks BC? | ✔️ |
| Fixed issues | #211, #333 |
symplify/git-wrapper is abandoned and depends on nette/utils v3.2.10 which requires PHP <8.4, breaking compatibility.
Changes
-
composer.json:
- Replace
symplify/git-wrapperwithgitonomy/gitlib ^1.5 - Update PHP requirement from
^8.0to^8.1(required bysymfony/process ^6.0andgitonomy/gitlib ^1.5)
- Replace
-
New adapter layer (
src/Infrastructure/Git/):-
GitRepository- wrapsGitonomy\Git\Repositorywith compatible API -
GitBranches,GitTags- simple value containers -
GitException- exception wrapper
-
-
Updated consumers:
Package.php,AddChangelogCommand,PushCommand,MakeCommand,ContributorsCommand
The adapter maintains API compatibility - callers use the same method names (getBranches(), tags(), checkout(), push(), etc.).
// Before
$git = $package->getGitWorkingCopy(); // Returns Symplify\GitWrapper\GitWorkingCopy
// After
$git = $package->getGitWorkingCopy(); // Returns Yiisoft\YiiDevTool\Infrastructure\Git\GitRepository
$git->getBranches()->all(); // Same API
$git->tags()->all(); // Same API
Breaking Change
The minimum PHP version requirement has been increased from ^8.0 to ^8.1. This is required because the Symfony 6.x packages and gitonomy/gitlib ^1.5 require PHP 8.1+.
Original prompt
This section details on the original issue you should resolve
<issue_title>Repo not compatible with PHP 8.4</issue_title> <issue_description>I am using this repo to run some basic tests for Yii 3.0 Docker images, but it is not compatible with PHP 8.4
https://github.com/yiisoft/yii-docker/actions/runs/18778578433/job/53578822639
Root composer.json requires symplify/git-wrapper ^10.2.0 -> satisfiable by symplify/git-wrapper[10.2.0, ..., 10.2.7]. - nette/utils v3.2.10 requires php >=7.2 <8.4 -> your php version (8.4.13) does not satisfy that requirement.There's no newer version of
symplify/git-wrapper, it is also marked as abandoned, see https://packagist.org/packages/symplify/git-wrapper</issue_description>Comments on the Issue (you are @copilot in this section)
@samdark Related to https://github.com/yiisoft/yii-dev-tool/issues/211
- Fixes yiisoft/yii-dev-tool#333
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.