PHPackages                             taylornetwork/class-scanner - 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. taylornetwork/class-scanner

ActiveLibrary

taylornetwork/class-scanner
===========================

04PHP

Since Aug 31Pushed 3y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PHP File Class Scanner
======================

[](#php-file-class-scanner)

> This is a fork of the original package that I've added a `"name"` to and added to Packagist so it can actually be installed via Composer. Intall via `composer require taylornetwork/class-scanner`If the original owner adds a name to the composer.json and uploads to packagist, this fork will be removed, unless I end up making changes.

The Class Scanner library provides a convenient interface for finding classes defined in PHP source code. The purpose of this library is to be able to find classes within a class hierarchy without the need of actually executing the code and loading the classes into memory.

Normally if you want to find, for example, all child classes for a specific class in PHP, you would probably first need to include all the files that contain all the possible classes and then construct a hierarchy using class reflection by inspect all defined classes. Sometimes, however, including every file may not be possible, or may even be dangerous.

This library offers an alternative by allowing you to scan files for class definitions without the need of executing them in order to find classes based on their hierarchy or just for determining what classes are defined in which files.

Api documentation is available at:

Requirements
------------

[](#requirements)

- PHP Version 7.1 or newer
- The [tokenizer](https://www.php.net/manual/en/tokenizer.installation.php) extension must not be disabled

Installation
------------

[](#installation)

Installation of this library is supported via composer. To install this library in your project, follow these steps:

1. Install composer by following [composer download instructions](https://getcomposer.org/download/)
2. Add this library to your project by running `composer require violet/class-scanner`

Usage
-----

[](#usage)

The basic question this library intends to help answer, is which classes in your codebase extend a specific class.

Let's say, for example, you want to find all classes in your project that extend that class `Application\Controller`. In order to do this, you could do:

```
