PHPackages                             gears/class-finder - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. gears/class-finder

AbandonedArchivedLibrary[File &amp; Storage](/categories/file-storage)

gears/class-finder
==================

Utility class to help you discover other classes / namespaces based on the composer auto loader.

v1.0.2(8y ago)694.9k8[2 issues](https://github.com/phpgearbox/class-finder/issues)[1 PRs](https://github.com/phpgearbox/class-finder/pulls)4MITPHPPHP ^7.0

Since Feb 27Pushed 7y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (5)Versions (4)Used By (4)

> Looking for maintainers, I no longer do much if any PHP dev, I have moved on, mostly work in dotnet core, node.js &amp; golang these days. If anyone is keen to take over these projects, get in touch -

Class Finder, like Symfony\\Finder but for classes.
===================================================

[](#class-finder-like-symfonyfinder-but-for-classes)

[![Build Status](https://camo.githubusercontent.com/ab81f0ebf2d7d40410b5dfcfb1f64e758171359eb440e81a51d20fa061addec3/68747470733a2f2f7472617669732d63692e6f72672f70687067656172626f782f636c6173732d66696e6465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phpgearbox/class-finder)[![Latest Stable Version](https://camo.githubusercontent.com/5062aeb6dcfe867d7f12651a219a2e62d73073ebdc093f6cb4177e77dbdd3876/68747470733a2f2f706f7365722e707567782e6f72672f67656172732f636c6173732d66696e6465722f762f737461626c652e737667)](https://packagist.org/packages/gears/class-finder)[![Total Downloads](https://camo.githubusercontent.com/039060fca78f19c6886970f7c7036bd24134fbb748ce72a8002bd6c919eef550/68747470733a2f2f706f7365722e707567782e6f72672f67656172732f636c6173732d66696e6465722f646f776e6c6f6164732e737667)](https://packagist.org/packages/gears/class-finder)[![License](https://camo.githubusercontent.com/3f37d00a7e010ba2f8c95b4addd77dc52f73a1b858b545580816933318f3ca49/68747470733a2f2f706f7365722e707567782e6f72672f67656172732f636c6173732d66696e6465722f6c6963656e73652e737667)](https://packagist.org/packages/gears/class-finder)[![Coverage Status](https://camo.githubusercontent.com/424a918a801fb5706a53bc3b0002a02049e974c26af4eaa686721682c1b9916d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f70687067656172626f782f636c6173732d66696e6465722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/phpgearbox/class-finder?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3836db5f9ee62e9941ec61ef442177ec80f4f89dfac122fb6e6aea0be7ce147e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70687067656172626f782f636c6173732d66696e6465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpgearbox/class-finder/?branch=master)

Utility class to help you discover other classes / namespaces based on the composer auto loader.

How to Install
--------------

[](#how-to-install)

Installation via composer is easy:

```
composer require gears/class-finder

```

Examples
--------

[](#examples)

```
// Make sure you grab the composer ClassLoader instance, the class finder needs it.
$composer = require('vendor/autoload.php');

// Create a new finder. You may reuse this as much as you like.
// Right now caching is not performed but could be in the future.
$finder = new Gears\ClassFinder($composer);

// Find all classes inside a namespace
$classes = $finder->namespace('Foo\\Bar')->search();

// Returns an array like:
$classes =
[
    '/home/user/project/vendor/foo/src/Bar/Baz.php' => 'Foo\\Bar\\Baz',
    '/home/user/project/vendor/foo/src/Bar/Qux.php' => 'Foo\\Bar\\Qux',
    'etc...'
];

// Find all classes inside a namespace that implement an interface.
$classes = $finder->namespace('Foo\\Bar')->implements('SomeInterface')->search();

// OR you can use the PHP 5.5 ::class operator
$classes = $finder->namespace('Foo\\Bar')->implements(SomeInterface::class)->search();

// Or filter by parent classes
$classes = $finder->namespace('Foo\\Bar')->extends(SomeParent::class)->search();

// NOTE: You can't do both out of the box.
$classes = $finder->namespace('Foo\\Bar')

// This is now allowed!
->implements(SomeInterface::class)
->extends(SomeParent::class)

->search();

// Although you could supply your own custom filter that implemented whatever filtering you like.
$classes = $finder->namespace('Foo\\Bar')->filterBy(function($rClass ReflectionClass)
{

    /* custom logic goes here, must return true or false */

})->search();

// ClassFinder also implements the IteratorAggregate & Countable interfaces.
$number = $finder->namespace('Foo\\Bar')->count();

foreach ($finder->namespace('Foo\\Bar') as $filepath => $fqcn)
{

}
```

---

Developed by Brad Jones -

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~197 days

Total

3

Last Release

2974d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b476564958ffc91db5580080738e529644f820bdfec6a6c4d397f9c5da45065?d=identicon)[brad-jones](/maintainers/brad-jones)

---

Top Contributors

[![brad-jones](https://avatars.githubusercontent.com/u/2754772?v=4)](https://github.com/brad-jones "brad-jones (2 commits)")[![molchanoviv](https://avatars.githubusercontent.com/u/1157468?v=4)](https://github.com/molchanoviv "molchanoviv (1 commits)")

---

Tags

reflectionclassdiscoverfinder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gears-class-finder/health.svg)

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

###  Alternatives

[yosymfony/resource-watcher

A simple resource watcher using Symfony Finder

698.2M22](/packages/yosymfony-resource-watcher)[ergebnis/classy

Provides collectors for classy constructs (classes, enums, interfaces, and traits).

382.8M20](/packages/ergebnis-classy)[arthurhoaro/favicon

PHP Library used to discover favicon from given URL

36737.4k](/packages/arthurhoaro-favicon)[edsdk/flmngr-server-php

Flmngr file manager PHP backend

20279.5k3](/packages/edsdk-flmngr-server-php)[samsonasik/array-lookup

A fast lookup library that help you verify and search array and Traversable data

2863.0k2](/packages/samsonasik-array-lookup)[mpclarkson/icon-scraper

PHP Library to get the apple-touch-icons and favicon from a website.

2129.2k](/packages/mpclarkson-icon-scraper)

PHPackages © 2026

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