PHPackages                             rkr/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. rkr/class-finder

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

rkr/class-finder
================

A tool to find full qualified class-names from a list of files

1.0.3(10mo ago)2104MITPHP

Since Aug 16Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/rkrx/php-class-finder)[ Packagist](https://packagist.org/packages/rkr/class-finder)[ RSS](/packages/rkr-class-finder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

PHP class finder
================

[](#php-class-finder)

You have to provide a list of file paths in which a php-class is to be searched for. Behind the scenes, [`nikic/php-parser`](https://packagist.org/packages/nikic/php-parser) is used to interpret the files. This means that the PHP files are not interpreted directly. This is much slower, than the approach, that [`haydenpierce/class-finder`](https://packagist.org/packages/haydenpierce/class-finder) is using.

`composer require rkr/class-finder`

Examples
--------

[](#examples)

### `ClassFinder::findClassesFromDirectory`

[](#classfinderfindclassesfromdirectory)

```
use Kir\ClassFinder\ClassFinder;

$startDir = __DIR__ . '/src';
$classNames = ClassFinder::findClassesFromDirectory($startDir);

print_r(iterator_to_array($classNames));
// Kir\ClassFinder\NodeVisitor
// Kir\ClassFinder\ClassFinder
// Kir\ClassFinder\ClassTools
// Kir\ClassFinder\ClassFinderResult
// Kir\ClassFinder\ClassFile
```

### `ClassFinder::findClassesFromIterableFileList`

[](#classfinderfindclassesfromiterablefilelist)

```
use Kir\ClassFinder\ClassFinder;

//region Gather the files
$startDir = __DIR__ . '/src';
$directory = new RecursiveDirectoryIterator($startDir, FilesystemIterator::FOLLOW_SYMLINKS | FilesystemIterator::SKIP_DOTS | FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_PATHNAME);
$iterator = new RecursiveIteratorIterator($directory);
$files = new CallbackFilterIterator($iterator, fn(string $path) => preg_match('{\\.p(hp\\d?|html)$}i', $path));
//endregion

$classNames = ClassFinder::findClassesFromIterableFileList($files);

print_r(iterator_to_array($classNames));
// Kir\ClassFinder\NodeVisitor
// Kir\ClassFinder\ClassFinder
// Kir\ClassFinder\ClassTools
// Kir\ClassFinder\ClassFinderResult
// Kir\ClassFinder\ClassFile
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance53

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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

Total

4

Last Release

328d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f83d7e57a4bf3f1309680dbfbbf2d022f0ee6dae64a4b3bdfbed1226f2f6bef?d=identicon)[rkr](/maintainers/rkr)

---

Top Contributors

[![rkrx](https://avatars.githubusercontent.com/u/5672982?v=4)](https://github.com/rkrx "rkrx (8 commits)")

---

Tags

classfinder

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/rkr-class-finder/health.svg)](https://phpackages.com/packages/rkr-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)
