-
Notifications
You must be signed in to change notification settings - Fork 47
Description
The Problem
When trying to upgrade a project to phpunit/phpunit v12, it breaks.
This is because this project doesn't support phpunit/php-timer v8.0, which phpunit v12 requires, in its composer.json.
Well, PHPExperts/SimpleDTO got hit by this, as did almost all of our other 70+ projects, as phpmnd is in the phpexperts/skeleton project, the basis of all of our projects...
Can't upgrade to PHPUnit v12 and use phpmnd at the same time :-/
The Solution
Ensure that this project also supports phpunit/php-timer v8.0, which means finding solutions to any backward-incompatible changes in a way that still supports all of the older versions you are supporting.
The Workaround
Use a phar.
I was able to resolve this by:
composer remove --dev phpunit/phpunit
composer remove --dev phpmnd/phpmnd
composer require --dev phpunit/phpunit '12.*'
curl https://www.bettergist.dev/phars/phpmnd.phar -o vendor/bin/phpmnd && chmod +x vendor/bin/phpmnd
I made a phar containing the latest master
of phpmnd, including php 8.4 support, and am hosting it on my bettergist website along with all the phars of now-dead projects.
Using the phar also removes all thirdparty packages, and increases the efficiency of PhpStorm indexing. So win/win.
Alternative Solution: Phar distribution
There is no reason to package this as a typical PHP library.
How many projects actually use phpmnd's source code in their own apps?
Well, I happen to archive literally every single PHP packagist project, weekly, and so I'm going to check... Specifically, i'm going to have my own local LLM parse through for any instance of "use Povils\PHPMND".
There's not a single alive packagist project that actually uses PHPMND source code internally.
So I created Issue #186: Convert this project to a pure phar distribution.