PHPackages                             cline/analyzer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. cline/analyzer

ActiveLibrary[Testing &amp; Quality](/categories/testing)

cline/analyzer
==============

Configurable parallel PHP code analyzer for checking class references

4.0.4(2mo ago)013.4k↓72%MITPHPPHP ^8.5.0CI failing

Since Mar 4Pushed 2mo agoCompare

[ Source](https://github.com/faustbrian/analyzer)[ Packagist](https://packagist.org/packages/cline/analyzer)[ RSS](/packages/cline-analyzer/feed)WikiDiscussions 4.x Synced 1w ago

READMEChangelog (2)Dependencies (31)Versions (19)Used By (0)

Analyzer
========

[](#analyzer)

Configurable parallel PHP code analyzer for checking class references with Laravel Prompts UI and AI agent orchestration.

Requirements
------------

[](#requirements)

> **Requires [PHP 8.4+](https://php.net/releases/) and Laravel 12+**

Installation
------------

[](#installation)

```
composer require cline/analyzer
```

The service provider will be automatically registered via Laravel's package discovery.

Features
--------

[](#features)

- **Laravel Artisan Command**: `php artisan analyzer:analyze` for 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
-----

[](#usage)

### Artisan Command

[](#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

[](#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

[](#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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=analyzer-config
```

This creates `analyzer.php` in your project root:

```
