Generates composer require commands from outdated dependencies. Works with any PHP project: Symfony, Laravel, Yii, CodeIgniter, Slim, Laminas, etc.
- ✅ Works with any PHP project
- ✅ Separates production and development dependencies
- ✅ Shows ignored packages with available versions
- ✅ Multi-framework support with version constraints:
- Symfony: respects
extra.symfony.require - Laravel: respects
laravel/framework+illuminate/*versions - Yii: respects
yiisoft/yii2version - CakePHP: respects
cakephp/cakephpversion - Laminas: respects
laminas/*versions - CodeIgniter: respects
codeigniter4/frameworkversion - Slim: respects
slim/slimversion
- Symfony: respects
- ✅ Compares versions to avoid unnecessary updates
- ✅ Can execute commands directly with
--runflag - ✅ Automatic installation via Composer plugin
composer require --dev nowo-tech/composer-update-helperAfter installation, two files will be copied to your project root:
generate-composer-require.sh- The main scriptgenerate-composer-require.ignore.txt- Configuration file for ignored packages (only created if doesn't exist)
Note: These files are automatically added to your .gitignore during installation to prevent them from being committed to your repository.
./generate-composer-require.shExample output:
⏭️ Ignored packages (prod):
- doctrine/doctrine-bundle:2.13.2
⏭️ Ignored packages (dev):
- phpunit/phpunit:11.0.0
🔧 Suggested commands:
composer require --with-all-dependencies vendor/package:1.2.3 another/package:4.5.6
composer require --dev --with-all-dependencies phpstan/phpstan:2.0.0
./generate-composer-require.sh --runEdit generate-composer-require.ignore.txt to exclude packages from updates:
# Packages to ignore during update
# Each line is a package name (e.g.: vendor/package)
doctrine/orm
symfony/security-bundle
laravel/frameworkIgnored packages will still be displayed in the output with their available versions, but won't be included in the composer require commands.
| Variable | Description | Default |
|---|---|---|
PHP_BIN |
Path to PHP binary | php |
COMPOSER_BIN |
Path to Composer binary | Auto-detected |
Example:
PHP_BIN=/usr/bin/php8.2 ./generate-composer-require.shThe script automatically detects your framework and respects version constraints to prevent breaking updates.
Respects extra.symfony.require in composer.json:
{
"extra": {
"symfony": {
"require": "8.0.*"
}
}
}Automatically detects laravel/framework version and limits all laravel/* and illuminate/* packages:
{
"require": {
"laravel/framework": "^12.0"
}
}| Framework | Core Package | Limited Packages |
|---|---|---|
| Yii | yiisoft/yii2 |
yiisoft/* |
| CakePHP | cakephp/cakephp |
cakephp/* |
| Laminas | laminas/laminas-mvc |
laminas/* |
| CodeIgniter | codeigniter4/framework |
codeigniter4/* |
| Slim | slim/slim |
slim/* |
🔧 Detected framework constraints:
- symfony 8.0.*
- laravel 12.0.*
⏭️ Ignored packages (prod):
- doctrine/orm:3.0.0
🔧 Suggested commands:
composer require --with-all-dependencies symfony/console:7.1.8
- PHP >= 7.4
- Composer 2.x
The project includes Docker configuration for easy development:
# Start the container
make up
# Install dependencies
make install
# Run tests
make test
# Run tests with coverage
make test-coverage
# Check code style
make cs-check
# Fix code style
make cs-fix
# Run all QA checks
make qa
# Open shell in container
make shell
# Stop container
make down
# Clean build artifacts
make cleanIf you have PHP and Composer installed locally:
# Clone repository
git clone https://github.com/nowo-tech/composer-update-helper.git
cd composer-update-helper
# Install dependencies
composer install
# Run tests
composer test
# Run tests with coverage
composer test-coverage
# Check code style
composer cs-check
# Fix code style
composer cs-fix
# Run all QA checks
composer qa| Command | Description |
|---|---|
make up |
Start Docker container |
make down |
Stop Docker container |
make shell |
Open shell in container |
make install |
Install Composer dependencies |
make test |
Run PHPUnit tests |
make test-coverage |
Run tests with code coverage |
make cs-check |
Check code style (PSR-12) |
make cs-fix |
Fix code style |
make qa |
Run all QA checks |
make clean |
Remove vendor and cache |
make setup-hooks |
Install git pre-commit hooks |
Install git hooks to automatically run CS-check and tests before each commit:
make setup-hooksThis ensures code quality checks run locally before pushing to GitHub.
Every push to GitHub automatically triggers:
- ✅ Tests on PHP 7.4, 8.0, 8.1, 8.2, 8.3
- ✅ Code Style check (PSR-12) with automatic fixes on main/master branch
- ✅ Code Coverage report with 100% coverage requirement
- ✅ Automatic code style fixes committed back to repository
- Automatic Code Style Fixes: On push to main/master, PHP CS Fixer automatically fixes code style issues and commits them back
- 100% Code Coverage: The CI pipeline requires 100% code coverage to pass, ensuring comprehensive test coverage
- Multi-PHP Testing: Tests run on all supported PHP versions (7.4, 8.0, 8.1, 8.2, 8.3)
- Pull Request Validation: On pull requests, code style is checked (but not auto-fixed) to maintain code quality
See GitHub Actions for build status.
The repository includes demo projects for different PHP frameworks to test the Composer Update Helper:
- Laravel 12 (PHP 8.5) - Latest stable version
- Symfony 8.0 (PHP 8.5) - Latest stable version
- Yii 2 (PHP 8.5) - Latest stable version (Yii 3 in development)
- CodeIgniter 4.6 (PHP 8.5) - Latest stable version
- Slim 4.12 (PHP 8.5) - Latest stable version
- Legacy - Laravel 12 (PHP 8.5) - Updated from Laravel 5.8
Each demo is independent and can be run separately with Docker Compose. See demo/README.md for detailed instructions.
# Using Makefile (recommended)
cd demo
make laravel # Start Laravel demo
make laravel-down # Stop Laravel demo
make laravel-install # Install dependencies
make laravel-test # Run tests
make all # Start all demos
# Generic commands
make up DEMO=laravel # Start a demo
make down DEMO=laravel # Stop a demo
make install DEMO=laravel # Install dependencies
make test DEMO=laravel # Run tests
make shell DEMO=laravel # Open shell
# Or using docker-compose directly
cd demo/laravel
cp .env.example .env # Copia y renombra (quita .example)
# Edita .env para cambiar PORT y contraseñas MySQL si es necesario
docker-compose up -d
# Access at http://localhost:8001See demo/README.md for complete documentation.
Please see CONTRIBUTING.md for details.
For branching strategy, see docs/BRANCHING.md.
Please see CHANGELOG.md for version history.
Created by Héctor Franco Aceituno at Nowo.tech
The MIT License (MIT). Please see LICENSE for more information.