PHP code example of delolmo / class-finder
1. Go to this page and download the library: Download delolmo/class-finder library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
delolmo / class-finder example snippets
use App\Handler\HandlerInterface;
use DelOlmo\ClassFinder\ClassFinder;
$classFinder = new ClassFinder();
// Every instantiable class declared in src/Handler
$classes = $classFinder->findAll(__DIR__ . '/src/Handler');
// Only those that extend or implement HandlerInterface
$handlers = $classFinder->findByClassName(HandlerInterface::class, __DIR__ . '/src/Handler');
use Symfony\Component\Finder\Finder;
$classFinder = new ClassFinder(
new Finder()->exclude('Tests')->notName('*Fixture.php'),
);