rector/monitor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rector/monitor

Composer 安装命令:

composer require rector/monitor

包简介

Monitor code quality for all your projects/packages in one place. Keep same PHP version, packages and even PHPStan extensions. Helps with merging multiple repositories to one.

README 文档

README

Downloads total

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.


Install

composer require rector/monitor --dev

1. Single place to Quality control Multiple repositories

vendor/bin/monitor analyze

This 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-cache

2. See full Matrix of Repositories' Dependencies

This 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


3. See Difference between Two Projects

  • 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-merged

This command will check:

  • differences in dependencies
  • differences in autoload
  • if Symfony, difference between config files
  • PHPStan analyzed paths
  • PHPStan extensions
  • PHPStan level

Happy coding!

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固