Monitor code quality for all your projects and packages in one place, ensuring consistency and eliminating conflicts across PHP versions.
"Got 99 packages, but same version share none" - unknown
Have a single place to monitor your projects and packages code quality from no more conflicts between packages, no more one project in PHP 8.1 and other in PHP 7.2.
composer require rector/monitor --devvendor/bin/monitor analyzeThis command will load monitor.php configuration file from project root. There you define repositories and requirements to meet:
use Rector\Monitor\Config\MonitorConfig;
return MonitorConfig::configure()
->addRepositories([
'https://github.com/rectorphp/rector-symfony',
'https://github.com/rectorphp/rector-doctrine',
'https://github.com/rectorphp/rector-phpunit',
'https://github.com/rectorphp/rector-downgrade-php',
])
->addRepositoryBranch('https://github.com/rectorphp/rector-src', 'main')
// ->addRepositoryBranch('...', 'stage')
// composer rules
->disallowPackages(['symfony/phpunit-bridge'])
->requirePackages([
'rector/rector',
'phpecs/phpecs',
'phpstan/phpstan',
'phpstan/extension-installer',
'symplify/phpstan-rules',
])
// version requirements
->minPackageVersion('phpstan/phpstan', '2.1')
->minPackageVersion('rector/rector', '2.2')
// other rules
->noPhpstanBaseline();The repositories are cloned locally and cached to get fast performance. To refresh them:
vendor/bin/monitor analyze --clear-cacheThis command shows dependency table for each defined repository. It will show which package versions are used in which repositories. This way you can easily spot conflicts between your packages and projects.
vendor/bin/monitor matrix↓
- Do you want to merge 2 projects into one monorepo?
- Are you curious how much are 2 project different to each other?
Compare them to eliminate their differences first, then make their merge smooth and easy:
vendor/bin/monitor compare <monorepo-project> --merge-project <project-to-be-merged>
# e.g.
vendor/bin/monitor compare ../monorepo-project --merge-project ../project-to-be-mergedThis command will check:
- differences in dependencies
- differences in autoload
- if Symfony, difference between config files
- PHPStan analyzed paths
- PHPStan extensions
- PHPStan level
Happy coding!
