Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Class Finder Laravel Package

danog/class-finder

Fast PHP class discovery utility. Scan directories/files and find classes, interfaces, and traits without manually maintaining lists. Useful for autoload-based plugins, reflection tooling, and package indexing, with a simple API and minimal setup.

View on GitHub
Deep Wiki
Context7

How Testing Works

Testing ClassFinder is a bit of an ordeal because the project is intimately related to autoloading.

Testing works by creating entire "sample applications" in the testing directory. These applications include their own composer.json and attempt to simulate a real application that composer required this project. Autoloading is accomplished by requiring in an older version of haydenpierce/class-finder. Autoloading is the only reason "haydenpierce/class-finder": "0.0.1" exists in the test app's composer.json file.

Tests can be run with this command (tested on Windows 10):

"vendor/bin/phpunit" "./test/app1/src/ClassFinderTest.php"

This starts off with a bootstrap script that copies in the existing src directory over the initially required haydenpierce/class-finder/src files. Therefore, blowing away any changes made there. This makes debugging kind of annoying because running xdebug on the test files will bring you into the test files. If you make changes directly to the test files, they will immediately be blown away on the next run of the tests. Don't make the same mistake I've made dozens of times.

If you're running the tests for the first time, you will encounter an error. This is because the test app is itself a composer application that must be installed. Currently, the necessary command to install will be output the first time you run the tests.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4