cline / analyzer
Configurable parallel PHP code analyzer for checking class references
Installs: 382
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cline/analyzer
Requires
- php: ^8.4.0
- illuminate/support: ^12.28
- laravel/prompts: ^0.3.3
- nikic/php-parser: ^5.4.0
- phpdocumentor/reflection-common: ^2.2
- phpdocumentor/reflection-docblock: ^5.6.1
- phpdocumentor/type-resolver: ^1.10.0
- symfony/process: ^7.2
Requires (Dev)
- cline/php-cs-fixer: ^1.0.4
- driftingly/rector-laravel: ^2.0.7
- ergebnis/composer-normalize: ^2.49@dev
- laravel/pint: ^1.25.1
- orchestra/testbench: ^10.6
- pestphp/pest: ^3.8.4
- pestphp/pest-plugin-laravel: ^3.2
- pestphp/pest-plugin-type-coverage: ^3.6.1
- phpstan/phpstan: ^2.1.30
- rector/rector: ^2.2.1
- spatie/laravel-package-tools: ^1.92
- symfony/var-dumper: ^7.3.4
README
Configurable parallel PHP code analyzer for checking class references with Laravel Prompts UI and AI agent orchestration.
Requirements
Requires PHP 8.4+ and Laravel 12+
Installation
composer require cline/analyzer
The service provider will be automatically registered via Laravel's package discovery.
Features
- Laravel Artisan Command:
php artisan analyzer:analyzefor easy CLI usage - AI Agent Mode: Generate XML-structured prompts for parallel AI-powered fixes
- Configurable Architecture: Replace core components via interfaces
- Parallel Processing: Analyze files concurrently with configurable worker count
- Laravel Prompts UI: Beautiful terminal reporting with summary statistics
- Flexible Resolution: Custom path, file, and analysis resolvers
- Based on graham-analyzer: Built on battle-tested analysis logic
Usage
Artisan Command
# Analyze default paths (app, tests) with auto-detected CPU cores php artisan analyzer:analyze # Analyze specific paths php artisan analyzer:analyze src tests # Auto-detect CPU cores for parallel processing php artisan analyzer:analyze --workers=auto # Specify exact worker count php artisan analyzer:analyze --workers=8 # Ignore specific class patterns php artisan analyzer:analyze --ignore="Illuminate\\*" --ignore="Symfony\\*" # Exclude files/directories from scanning php artisan analyzer:analyze --exclude=vendor --exclude=storage # AI agent mode - outputs XML prompts for automated fixing php artisan analyzer:analyze --agent
Programmatic Usage
use Cline\Analyzer\Analyzer; use Cline\Analyzer\Config\AnalyzerConfig; $config = AnalyzerConfig::make() ->paths(['app', 'tests']) ->workers(0) // 0 = auto-detect CPU cores ->ignore(['Illuminate\\*']) ->exclude(['vendor', 'storage']); $analyzer = new Analyzer($config); $results = $analyzer->analyze();
AI Agent Mode
Generate structured prompts for spawning parallel AI agents to fix issues:
$config = AnalyzerConfig::make() ->paths(['app']) ->agentMode(); $analyzer = new Analyzer($config); $analyzer->analyze();
This outputs XML-structured orchestration prompts grouped by namespace for efficient parallel processing.
Configuration
Publish the configuration file:
php artisan vendor:publish --tag=analyzer-config
This creates analyzer.php in your project root:
<?php use Cline\Analyzer\Config\AnalyzerConfig; return AnalyzerConfig::make() ->paths(['app', 'tests']) ->workers(0) // 0 = auto-detect CPU cores, or specify (e.g., 4, 8) ->ignore(['Illuminate\\*', 'Symfony\\*']) ->exclude(['vendor', 'node_modules', 'storage']);
Custom Resolvers
Implement custom resolution logic:
use Cline\Analyzer\Contracts\PathResolverInterface; class CustomPathResolver implements PathResolverInterface { public function resolve(array $paths): array { // Custom path resolution logic return $resolvedPaths; } }
Change log
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.
Credits
License
The MIT License. Please see License File for more information.