Classifier traverses file system to find classes by a certain criteria.
- PHP 8.0 or higher.
The package could be installed with Composer:
composer require yiisoft/classifier
Usage of classifier is the following:
use \Yiisoft\Classifier\Classifier;
use \Psr\SimpleCache\CacheInterface;
$cacheInstances = (new Classifier('src'))
->withInterface(CacheInterface::class) // can use ->withParentClass() instead
->withAttribute(MyAttribute::class)
->find();
You specify one more directories to traverse, interfaces, base classes, attributes to search for and call find()
method which returns a list of classes found.
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
The Yii Classifier is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.