Download the PHP package componenta/class-finder without Composer

On this page you can find all versions of the php package componenta/class-finder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package class-finder

Componenta ClassFinder

Lazy PHP declaration discovery with composable filters and listener notification.

ClassFinder scans PHP files, extracts named class/interface/trait/enum declarations through componenta/tokenizer, applies filters, and returns a replayable iterator of ClassInfo metadata.

Installation

Requirements

Related Packages

Package Why it matters here
componenta/tokenizer Parses PHP source and returns ClassInfo declarations.
symfony/finder Walks directories and selects PHP files.
componenta/iterator Provides replayable iteration over discovered declarations.
componenta/filter Provides composable filters used by the finder.
componenta/app and *-app packages Run class discovery while building application cache.

Quick Start

Search Modes

find() accepts the tokenizer search bitmask directly:

Search mode is a per-call argument. It is not a DI configuration key.

ClassIterator

ClassFinder::find() returns ClassIteratorInterface: lazy, replayable, countable, arrayable, and filterable.

The iterator caches traversed declarations so it can be iterated more than once.

Pattern Filters

PatternFilter matches ClassInfo metadata without reflection.

Use exactNamespace() when the input is a namespace without wildcard. A bare string containing \ is treated as a fully-qualified class name or FQN pattern.

Reflection Filters

Some filters require the declaration to be loaded because they use ClassInfo::$reflector:

These filters are appropriate when scanned classes are autoloadable. For pure source inspection of unloaded files, prefer metadata-only filters such as PatternFilter, InstantiableFilter, IsAbstractFilter, and IsFinalFilter.

Attribute Filters

deepSearch: true also checks methods, properties, and constants.

Listeners

Listeners are notified for each accepted declaration. Finalizable listeners are finalized after scanning, even when no declarations were found.

ClassListenerNotifier snapshots the provider's listeners once per notify() call, so the same listener instances receive handle() and finalize().

When a finalizable listener is later compiled into an application build cache, it should also implement FinalizationStateInterface. The finalized property becomes true only after a successful finalize() call. Repeated finalization may be rejected by the listener; the package provides FinalizationExceptionInterface and ListenerAlreadyFinalizedException for that case.

Compile Integration

Packages that collect metadata through listeners can expose compilers without depending on an application runner:

Register compiler class names under Componenta\ClassFinder\Compile\ConfigKey::LISTENER_COMPILERS. The host application decides when discovery runs and where sidecar files are written.

A listener compiler should not scan classes, call finalize(), or read private listener state through reflection. It receives an object that has already passed through the discovery lifecycle. The componenta/app integration checks before compilation that a finalizable listener implements FinalizationStateInterface and is already finalized.

Container Integration

Register the package provider in a PSR-11 compatible container:

Runtime configuration keys are defined in Componenta\ClassFinder\ConfigKey:

Constant Value Description
ConfigKey::FILTERS Componenta\ClassFinder:filters Default FilterInterface instances for ClassFinderFactory.
ConfigKey::LISTENERS Componenta\ClassFinder:listeners Listener service ids or ClassListenerInterface instances.

Listener config is fail-fast: every entry must be a listener instance or a service id string resolving to ClassListenerInterface.

License

MIT


All versions of class-finder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
symfony/finder Version ^7.0 || ^8.0
componenta/tokenizer Version ^1.0
componenta/arrayable Version ^1.0
componenta/config Version ^2.0
componenta/filter Version ^1.0
componenta/iterator Version ^1.0
psr/log Version ^3.0
psr/container Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package componenta/class-finder contains the following files

Loading the files please wait ...