Download the PHP package bermudaphp/reflection without Composer

On this page you can find all versions of the php package bermudaphp/reflection. 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 reflection

Bermuda Reflection

Русская версия

A powerful static utility class for PHP reflection operations with built-in caching and advanced metadata (attributes) handling. Provides convenient methods for working with PHP 8+ attributes and reflection objects.

Features

Installation

Requirements

Quick Start

Basic Attribute Retrieval

Universal Reflection

Advanced Features

Deep Attribute Search

Search for attributes not only on the class itself, but also on all its members:

Path Format for Deep Search

Deep search results use descriptive paths to identify where attributes were found:

Reflection Caching

The class automatically caches reflection objects for improved performance:

API Reference

Metadata Methods

getMetadata()

Retrieves all attributes from a reflection object. Optionally filter by attribute class name.

getFirstMetadata()

Gets the first attribute instance of the specified type.

hasMetadata()

Checks if the reflection object has any attributes of the specified type.

Deep Search Methods

getDeepMetadata()

Searches for attributes in the class and all its members (methods, properties, constants).

getFirstDeepMetadata()

Gets the first attribute instance found anywhere in the class.

hasDeepMetadata()

Checks if the class or any of its members have the specified attribute.

Reflection Creation Methods

reflect()

Universal reflection method that automatically determines the appropriate reflection type.

callable()

Creates reflection for callable types (functions, methods, closures).

object()

Creates cached ReflectionObject for the given object instance.

class()

Creates cached ReflectionClass for the given class name. Returns null if class doesn't exist.

Real-World Examples

Dependency Injection Container

Route Discovery

Validation with Attributes

Event Handler Discovery

Performance Tips

  1. Leverage Caching: The class automatically caches reflection objects, so prefer using static methods over creating new reflections manually
  2. Use Specific Searches: When searching for specific attribute types, pass the class name to avoid unnecessary processing
  3. Deep Search Wisely: Use deep search only when you need to search in class members, as it's more expensive than regular metadata retrieval
  4. Batch Operations: When working with multiple classes, the caching system provides significant performance benefits

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of reflection with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
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 bermudaphp/reflection contains the following files

Loading the files please wait ...