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.1M↓41.3%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 today

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 86% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity48

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

2363d 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

[mobiledetect/mobiledetectlib

Mobile\_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

10.7k170.9M526](/packages/mobiledetect-mobiledetectlib)[illuminate/contracts

The Illuminate Contracts package.

706130.3M13.3k](/packages/illuminate-contracts)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

378604.0k104](/packages/flow-php-etl)[phiki/phiki

Syntax highlighting using TextMate grammars in PHP.

3693.8M55](/packages/phiki-phiki)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)

PHPackages © 2026

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