Skip to content

Classifier traverses file system to find classes by a certain criteria.

License

Notifications You must be signed in to change notification settings

yiisoft/classifier

Yii

Yii Classifier


Latest Stable Version Total Downloads Build status Scrutinizer Code Quality Code Coverage Mutation testing badge static analysis type-coverage

Classifier traverses file system to find classes by a certain criteria.

Requirements

  • PHP 8.0 or higher.

Installation

The package could be installed with Composer:

composer require yiisoft/classifier

Documentation

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.

License

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.

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack