PHPackages                             piotrpress/composer-classmapper - 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. piotrpress/composer-classmapper

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

piotrpress/composer-classmapper
===============================

This Composer command generates a classmap.php file based on project files.

v3.1.0(2y ago)01012MITPHPPHP &gt;=7.4

Since May 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/PiotrPress/composer-classmapper)[ Packagist](https://packagist.org/packages/piotrpress/composer-classmapper)[ Docs](https://github.com/PiotrPress/composer-classmapper)[ RSS](/packages/piotrpress-composer-classmapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (2)

Composer ClassMapper
====================

[](#composer-classmapper)

This Composer command generates a `classmap.php` file based on project files.

**NOTE:** The command can be executed in projects without `composer.json` file too.

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

[](#installation)

1. Add the command as a global composer plugin:

```
$ composer global require piotrpress/composer-classmapper
```

2. Allow plugin execution:

```
$ composer config -g allow-plugins.piotrpress/composer-classmapper true
```

Usage
-----

[](#usage)

1. Execute the command in project's directory:

```
$ composer map [-e|--exclude [REGEX]]
```

**NOTE:** The option `exclude` is regex that matches file paths to be excluded from the classmap.

2. After the command execution, simply include autoload file in the project:

```
require __DIR__ . '/autoload.php';
```

Example
-------

[](#example)

```
$ composer map -e"#/vendor/composer/(.*)#"
```

License
-------

[](#license)

[MIT](license.txt)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~175 days

Recently: every ~262 days

Total

7

Last Release

774d ago

Major Versions

v1.0.2 → v2.0.02022-02-14

v2.0.1 → v3.0.02024-01-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10326736?v=4)[Piotr Niewiadomski](/maintainers/PiotrPress)[@PiotrPress](https://github.com/PiotrPress)

---

Top Contributors

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

---

Tags

autoloadautoloaderautoloadingclassmapclassmappingcomposercomposer-scriptsphpclassmapcomposerautoloadmapautoloadercomposer-plugincomposer commandcomposer-scriptclassmapperclass mapcomposer classmapcomposer map

### Embed Badge

![Health badge](/badges/piotrpress-composer-classmapper/health.svg)

```
[![Health](https://phpackages.com/badges/piotrpress-composer-classmapper/health.svg)](https://phpackages.com/packages/piotrpress-composer-classmapper)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M15](/packages/vaimo-composer-patches)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

525.5M67](/packages/automattic-jetpack-autoloader)[funkjedi/composer-include-files

Include files at a higher priority than autoload files.

1263.2M19](/packages/funkjedi-composer-include-files)[typo3/class-alias-loader

Amends the composer class loader to support class aliases to provide backwards compatibility for packages

4313.7M21](/packages/typo3-class-alias-loader)[liborm85/composer-vendor-cleaner

Composer Vendor Cleaner removes unnecessary development files and directories from vendor directory.

35342.7k1](/packages/liborm85-composer-vendor-cleaner)[linkorb/autotune

Tune your autoloader

177.0k17](/packages/linkorb-autotune)

PHPackages © 2026

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