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(1y ago)2119MITPHP

Since Aug 16Pushed 1y 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 1w 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

33

—

LowBetter than 72% of packages

Maintenance46

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

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

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.2k12.6M138](/packages/dedoc-scramble)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[cakephp/bake

Bake plugin for CakePHP

11212.2M223](/packages/cakephp-bake)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1892.4M48](/packages/dereuromark-cakephp-ide-helper)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

55344.7k5](/packages/jolicode-castor)

PHPackages © 2026

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