Download the PHP package hanneskod/classtools without Composer
On this page you can find all versions of the php package hanneskod/classtools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hanneskod/classtools
More information about hanneskod/classtools
Files in hanneskod/classtools
Package classtools
Short Description Find, extract and process classes from file system
License WTFPL
Homepage https://github.com/hanneskod/classtools
Informations about the package classtools
hanneskod/classtools
Find, extract and process classes from the file system.
Installation
Install using composer. Exists as hanneskod/classtools in the packagist repository. From the command line use:
composer require hanneskod/classtools
Using the iterator
ClassIterator consumes a symfony finder and scans files for php classes, interfaces and traits.
Access the class map
getClassMap()
returns a map of class names to
SplFileInfo
objects.
Find syntax errors
Source files containing syntax errors can not be parsed and hence no information
on contained classes can be retrieved. Use getErrors()
to read the list of
encountered errors.
Iterate over ReflectionClass objects
ClassIterator is also a Traversable, that on iteration yields class names as keys and ReflectionClass objects as values.
Note that to use reflection the classes found in filesystem must be included in the environment. Enable autoloading to dynamically load classes from a ClassIterator.
Filter based on class properties
ClassIterator is filterable and filters are chainable.
Negate filters
Filters can also be negated by wrapping them in not()
method calls.
Transforming classes
Found class, interface and trait definitions can be transformed and written to a single file.