dereuromark/composer-prefer-lowest
Composer plugin to help you work with prefer-lowest setups by managing minimum dependency versions and related constraints. Useful for testing packages against lowest supported dependencies and keeping composer.json requirements consistent.
Support "composer/semver": "^1.4 || ^2.0 || ^3.0"
Note: Now PHP 7.3+
Support a min/max range of e.g. "^4.2.12 < 4.3.0 || ^4.3.8 || ^5.0.0".
The first is internally translated to "[== 4.2.12.0 < 4.3.0.0-dev]" and therefore needs special treatment.
PHP 7.2+ with types added and PHP 8 checking in CI. From using side nothing should change or be an issue if you use a high enough PHP version to run this tool.
Fixed wildcard parsing.
Fixed range parsing.
Add --majors-only/-m option to be able to only fail on major issues.
Skip also dev-... aliased branches. We are mainly interested in stable releases here.
When declared both in require and require-dev, this issues just a warning, not an error. The build will not fail, as this seems to be intentional (to make prefer-lowest pass here). Still a valid warning, as this way it is impossible to test the promised minimum. Consider injecting the require-dev dependency in Travis more dynamically where needed.
Fixed output of errors in CLI.
Try it out :)
E.g. for Travis CI:
php:
- ...
- 7.3
env:
global:
- DEFAULT=1
matrix:
include:
- php: 5.6
env: PREFER_LOWEST=1
before_script:
- if [[ $PREFER_LOWEST != 1 ]]; then composer install --prefer-source --no-interaction; fi
- if [[ $PREFER_LOWEST == 1 ]]; then composer update --prefer-lowest --prefer-dist --prefer-stable --no-interaction; fi
- if [[ $PREFER_LOWEST == 1 ]]; then composer require --dev dereuromark/composer-prefer-lowest; fi
script:
- if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
- if [[ $PREFER_LOWEST == 1 ]]; then vendor/bin/validate-prefer-lowest; fi
How can I help you explore Laravel packages today?