PHPackages                             thecodingmachine/class-explorer - 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. thecodingmachine/class-explorer

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

thecodingmachine/class-explorer
===============================

Find the list of all your classes and more.

v1.1.0(6y ago)122.0M—7.4%6[2 issues](https://github.com/thecodingmachine/class-explorer/issues)[3 PRs](https://github.com/thecodingmachine/class-explorer/pulls)2MITPHPPHP &gt;=7.1CI failing

Since Sep 12Pushed 2y ago7 watchersCompare

[ Source](https://github.com/thecodingmachine/class-explorer)[ Packagist](https://packagist.org/packages/thecodingmachine/class-explorer)[ Docs](https://github.com/thecodingmachine/class-explorer)[ RSS](/packages/thecodingmachine-class-explorer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (9)Versions (5)Used By (2)

Class Explorer
==============

[](#class-explorer)

[![Latest Stable Version](https://camo.githubusercontent.com/6ad2adf765042e564f9d55b5cbcd33fe3139bbee1efe802f8f6e6c4fd1baa64d/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f636c6173732d6578706c6f7265722f762f737461626c65)](https://packagist.org/packages/thecodingmachine/class-explorer)[![Total Downloads](https://camo.githubusercontent.com/b35c5cce8b5da5bb491c30696fec59941e7c2e5a7514b75bd1cc6721d6d96a21/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f636c6173732d6578706c6f7265722f646f776e6c6f616473)](https://packagist.org/packages/thecodingmachine/class-explorer)[![Latest Unstable Version](https://camo.githubusercontent.com/f94b533e1615dbab58ad6d84f07e851668f28fa38c8cdcaeea96265cd021e625/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f636c6173732d6578706c6f7265722f762f756e737461626c65)](https://packagist.org/packages/thecodingmachine/class-explorer)[![License](https://camo.githubusercontent.com/1034f95167e025b92bf4db8352452d97f42d06b0f7d7fae269fd42f07a2d0727/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f636c6173732d6578706c6f7265722f6c6963656e7365)](https://packagist.org/packages/thecodingmachine/class-explorer)[![Build Status](https://camo.githubusercontent.com/0ffa2d3bf136c2ef30b8d24f9587f287793cd63037de6d2a0f9d1089e254c54a/68747470733a2f2f7472617669732d63692e6f72672f746865636f64696e676d616368696e652f636c6173732d6578706c6f7265722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thecodingmachine/class-explorer)[![Coverage Status](https://camo.githubusercontent.com/41a3337dd740d26048435bb6bdc83797dbfd182f636a3f972f7b7c519d8e9363/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f746865636f64696e676d616368696e652f636c6173732d6578706c6f7265722f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/thecodingmachine/class-explorer?branch=master)

Discover PHP classes in your project.

This project aim is to offer a set of classes enabling classes/interface/trait discovery in your own project.

Currently, the project contains only one implementation based on scanning files.

GlobClassExplorer
-----------------

[](#globclassexplorer)

The `GlobClassExplorer` will look for all classes in a given namespace.

Usage
-----

[](#usage)

```
$explorer = new GlobClassExplorer('\\Some\\Namespace\\', $psr16Cache, $cacheTtl);
$classes = $explorer->getClasses();
// Will return: ['Some\Namespace\Foo', 'Some\Namespace\Bar', ...]
```

This explorer:

- looks only for classes in YOUR project (not in the vendor directory)
- assumes that if a file exists in a PSR-0 or PSR-4 directory, the class is available (assumes the file respects PSR-1)
- makes no attempt at autoloading the class
- is pretty fast, even when no cache is involved

By default, `GlobClassExplorer` will load classes recursively in sub-namespaces. You can prevent it to load classes recursively by passing `false` to the 5th parameter:

```
$explorer = new GlobClassExplorer('\\This\\Namespace\\Only\\', $psr16Cache, $cacheTtl, null, false);
```

You can also get a class map using the `getClassMap` method. A class map is an array associating the name of the classes found (in key), to the file they are linked to (the real path of the file).

```
$classMap = $explorer->getClassMap();
foreach ($classMap as $class => $file) {
    echo 'Class '.$class.' found in file '.$file;
}
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 96.4% 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 ~162 days

Total

4

Last Release

2317d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

![](https://avatars.githubusercontent.com/u/1847918?v=4)[TheCodingMachine](/maintainers/thecodingmachine)[@thecodingmachine](https://github.com/thecodingmachine)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (27 commits)")[![Zheness](https://avatars.githubusercontent.com/u/5830103?v=4)](https://github.com/Zheness "Zheness (1 commits)")

---

Tags

reflectionclasses

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/thecodingmachine-class-explorer/health.svg)

```
[![Health](https://phpackages.com/badges/thecodingmachine-class-explorer/health.svg)](https://phpackages.com/packages/thecodingmachine-class-explorer)
```

###  Alternatives

[phpdocumentor/reflection-common

Common reflection classes used by phpdocumentor to reflect the code structure

9.1k706.8M26](/packages/phpdocumentor-reflection-common)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[gehrisandro/tailwind-merge-php

TailwindMerge for PHP merges multiple Tailwind CSS classes by automatically resolving conflicts between them

1391.5M9](/packages/gehrisandro-tailwind-merge-php)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12521.4M109](/packages/phpdocumentor-reflection)[php-di/phpdoc-reader

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

7431.6M55](/packages/php-di-phpdoc-reader)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)

PHPackages © 2026

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