Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Iterators to list all the PHP classes within a directory

License

Notifications You must be signed in to change notification settings

codeinchq/directory-classes-iterator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DirectoryClassesIterator

This package provides two directory iterators to list PHP classes :

The iterator loads the .php files using include_once() and then the ReflectionClass API to detect classes found within the loaded files.

Usage

<?php
use CodeInc\DirectoryClassesIterator\RecursiveDirectoryClassesIterator;
use CodeInc\DirectoryClassesIterator\DirectoryClassesIterator;

// recursive listing 
$iterator = new RecursiveDirectoryClassesIterator('/path/to/libriaries');

// recursive listing with specific extensions
$iterator = new RecursiveDirectoryClassesIterator('/path/to/libriaries', ['php', 'phtml', 'inc']);

// non recursive listing
$iterator = new DirectoryClassesIterator('/path/to/libriaries');

Installation

This library is available through Packagist and can be installed using Composer:

composer require codeinc/directory-classes-iterator

License

The library is published under the MIT license (see LICENSE file).

About

Iterators to list all the PHP classes within a directory

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages