PHPackages                             bigwhoop/php-extract-class-components - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bigwhoop/php-extract-class-components

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bigwhoop/php-extract-class-components
=====================================

Extract components (methods and properties interacting with each other) from a PHP class. The result can be visualized and aid in splitting up classes.

2.0.0(2y ago)12MITPHPPHP ^8.2|^8.3

Since Nov 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/bigwhoop/php-extract-class-components)[ Packagist](https://packagist.org/packages/bigwhoop/php-extract-class-components)[ RSS](/packages/bigwhoop-php-extract-class-components/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (4)Used By (0)

php-class-components-extractor
==============================

[](#php-class-components-extractor)

This little tool helps you visualize the cohesion of a class by showing the relationship between its methods and properties. It helps you to follow the SRP (Single Responsiblity Principle) by showing you how a class could be split up.

```
class Example
{
    private $a;
    private $b;
    private $c;

    public function a(): void
    {
        $this->a;
    }

    public function ab(): void
    {
        $this->a;
        $this->b;
    }

    public function c(): void
    {}
}
```

[![Example](/screenshot.png?raw=true "Example")](/screenshot.png?raw=true)

How to install
--------------

[](#how-to-install)

```
composer require bigwhoop/php-extract-class-components
```

How to use
----------

[](#how-to-use)

```
vendor/bin/php-class-components-extractor Path/To/Your/Class.php
```

Check the `-h` option for more information:

```
Usage: ./class-components-extractor [options] input

Arguments:
  input                 Path to a PHP file or - to use STDIN

Options:
  -h --help             Shows this help
  -f --format   Output format to use. One of the followwing:
                          json      JSON (default)
                          text      Human-readable representation
                          graphviz  Graphviz's graph description language

Examples:
  ./class-components-extractor file.php
  ./class-components-extractor file.php > components.json
  ./class-components-extractor --format text file.php
  ./class-components-extractor --format graphviz file.php | dot -Tpng -o diagram.png
  cat file.php | ./class-components-extractor --graphviz - | dot -Tpng -o diagram.png
```

Contributing
------------

[](#contributing)

### How to run tests

[](#how-to-run-tests)

```
vendor/bin/phpstan
vendor/bin/phpunit
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~975 days

Total

3

Last Release

791d ago

Major Versions

1.0.1 → 2.0.02024-03-10

PHP version history (2 changes)1.0.0PHP ^7.2

2.0.0PHP ^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b774aefc248ca286105741826106bafa344b5f99acd30021d7c895e5b7cf1d4b?d=identicon)[bigwhoop](/maintainers/bigwhoop)

---

Top Contributors

[![bigwhoop](https://avatars.githubusercontent.com/u/242589?v=4)](https://github.com/bigwhoop "bigwhoop (7 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bigwhoop-php-extract-class-components/health.svg)

```
[![Health](https://phpackages.com/badges/bigwhoop-php-extract-class-components/health.svg)](https://phpackages.com/packages/bigwhoop-php-extract-class-components)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M567](/packages/symfony-maker-bundle)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[recca0120/laravel-erd

Laravel ERD automatically generates Entity-Relationship Diagrams from your Laravel models and displays them using Vuerd.

36072.0k](/packages/recca0120-laravel-erd)[ondrejmirtes/better-reflection

Better Reflection - an improved code reflection API

136.2M4](/packages/ondrejmirtes-better-reflection)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
