PHPackages                             lighth7015/runtime-class-info - 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. lighth7015/runtime-class-info

ActiveLibrary

lighth7015/runtime-class-info
=============================

Allows you to list full qualified class names in directories and files.

1.3.2(6y ago)05MITPHPPHP ^7.2

Since Oct 13Pushed 4y agoCompare

[ Source](https://github.com/lighth7015/runtime-class-info)[ Packagist](https://packagist.org/packages/lighth7015/runtime-class-info)[ RSS](/packages/lighth7015-runtime-class-info/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (13)Used By (0)

List all PHP classes in directories and files
=============================================

[](#list-all-php-classes-in-directories-and-files)

[![Build Status](https://camo.githubusercontent.com/1a54d4e78462f945785139ee87903b4c1e11027edf8c2c53f914564e376ac1df/68747470733a2f2f7472617669732d63692e636f6d2f57797269486178696d75732f7068702d6c6973742d636c61737365732d696e2d6469726563746f72792e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/WyriHaximus/php-list-classes-in-directory)[![Latest Stable Version](https://camo.githubusercontent.com/da8896ebaad6b43dc3a59b72e454b815802bf2d043ff95d89c74b76d7be4f3c6/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6c6973742d636c61737365732d696e2d6469726563746f72792f762f737461626c652e706e67)](https://packagist.org/packages/wyrihaximus/list-classes-in-directory)[![Total Downloads](https://camo.githubusercontent.com/bdd8a3cb97abc6e67cecbb619da4c2f88ebce24108dbedf7b74be3832ac8933b/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6c6973742d636c61737365732d696e2d6469726563746f72792f646f776e6c6f6164732e706e67)](https://packagist.org/packages/wyrihaximus/list-classes-in-directory/stats)[![Code Coverage](https://camo.githubusercontent.com/96b8f5de7755f4c0fc911d76715176e17f40586c3ac1214c7f0251b4af2a44ea/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f77797269686178696d75732f7068702d6c6973742d636c61737365732d696e2d6469726563746f72792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wyrihaximus/php-list-classes-in-directory/?branch=master)[![License](https://camo.githubusercontent.com/abe43237f60f1292229e6e7be4c8d8e06233bea424827b60b2cea4c25e85f818/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6c6973742d636c61737365732d696e2d6469726563746f72792f6c6963656e73652e706e67)](https://packagist.org/packages/wyrihaximus/list-classes-in-directory)[![PHP 7 ready](https://camo.githubusercontent.com/0ad8d2dd7ceb2cee01c5a6da65a6f955614165a3d58936cd794442557025feae/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f77797269686178696d75732f7068702d6c6973742d636c61737365732d696e2d6469726563746f72792f62616467652e737667)](https://travis-ci.org/WyriHaximus/php-list-classes-in-directory)

Install
=======

[](#install)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/list-classes-in-directory

```

Usage
=====

[](#usage)

#### get a list of classes from multiple directories.

[](#get-a-list-of-classes-from-multiple-directories)

```
use function WyriHaximus\listClassesInDirectories;
use function WyriHaximus\listInstantiatableClassesInDirectories;
use function WyriHaximus\listNonInstantiatableClassesInDirectories;

// $classes now contains a list of full qualified class names from 'src/' and 'tests/'
$classes = listClassesInDirectories(
    __DIR__ . '/src',
    __DIR__ . '/tests'
);

// use listInstantiatableClassesInDirectories() or listNonInstantiatableClassesInDirectories() to only consider classes that can actually be instantiated, or not.
$instantiatableClasses = listInstantiatableClassesInDirectory(
    __DIR__ . '/src',
    __DIR__ . '/tests'
);
$nonInstantiatableClasses = listNonInstantiatableClassesInDirectory(
    __DIR__ . '/src',
    __DIR__ . '/tests'
);
```

#### get a list of classes from one directory.

[](#get-a-list-of-classes-from-one-directory)

```
use function WyriHaximus\listClassesInDirectory;
use function WyriHaximus\listInstantiatableClassesInDirectory;
use function WyriHaximus\listNonInstantiatableClassesInDirectory;

// $classes now contains a list of full qualified class names from __DIR__
$classes = listClassesInDirectory(__DIR__);

// use listInstantiatableClassesInDirectory() or listNonInstantiatableClassesInDirectory() to only consider classes that can actually be instantiated, or not.
$instantiatableClasses = listInstantiatableClassesInDirectory(__DIR__);
$nonInstantiatableClasses = listNonInstantiatableClassesInDirectory(__DIR__);
```

#### get a list of classes from multiple files.

[](#get-a-list-of-classes-from-multiple-files)

```
use function WyriHaximus\listClassesInFiles;

// $classes now contains a list of full qualified class names from 'Bar.php' and 'Foo.php'
$classes = listClassesInFiles(
    __DIR__ . '/Bar.php',
    __DIR__ . '/Foo.php'
);
```

#### get a list of classes from one file.

[](#get-a-list-of-classes-from-one-file)

```
use function WyriHaximus\listClassesInFile;

// $classes now contains a list of full qualified class names from 'Foo.php'
$classes = listClassesInFile(__DIR__.'/Foo.php');
```

Acknowledgement
===============

[](#acknowledgement)

This package is a shorthand function for using [`better reflection`](https://github.com/Roave/BetterReflection/) and is based on one of the [`examples`](https://github.com/Roave/BetterReflection/blob/396a07c9d276cb9ffba581b24b2dadbb542d542e/demo/parsing-whole-directory/example2.php).

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2018 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~137 days

Total

6

Last Release

2216d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3adbf2f82cf380f68ecf24b4be52f5741b4a0d98cfe0b33cfa8362df5117513?d=identicon)[lighth7015](/maintainers/lighth7015)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (42 commits)")[![azjezz](https://avatars.githubusercontent.com/u/29315886?v=4)](https://github.com/azjezz "azjezz (23 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![lighth7015](https://avatars.githubusercontent.com/u/671336?v=4)](https://github.com/lighth7015 "lighth7015 (5 commits)")[![holtkamp](https://avatars.githubusercontent.com/u/776405?v=4)](https://github.com/holtkamp "holtkamp (3 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")

### Embed Badge

![Health badge](/badges/lighth7015-runtime-class-info/health.svg)

```
[![Health](https://phpackages.com/badges/lighth7015-runtime-class-info/health.svg)](https://phpackages.com/packages/lighth7015-runtime-class-info)
```

###  Alternatives

[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[spatie/typescript-transformer

This is my package typescript-transformer

3706.5M16](/packages/spatie-typescript-transformer)[mateffy/laravel-introspect

Analyze Laravel codebases and find structured information about models, routes and other Laravel-specific things.

1698.7k2](/packages/mateffy-laravel-introspect)[wyrihaximus/list-classes-in-directory

Allows you to list full qualified class names in directories and files.

23304.8k7](/packages/wyrihaximus-list-classes-in-directory)[shopsys/framework

Core of Shopsys Platform - open source framework for building large, scalable, fast-growing e-commerce projects based on Symfony

25211.4k19](/packages/shopsys-framework)[bartlett/umlwriter

Create UML class diagrams from your PHP source.

6313.0k1](/packages/bartlett-umlwriter)

PHPackages © 2026

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