Download the PHP package mykemeynell/reflection without Composer

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

Reflection

CI/CD (main) CI/CD (dev) PHP Version PSR-11 Compliant

Reflection is a dependency injection container for PHP powered by auto-wiring and reflection.

It supports auto-wiring, contextual bindings, singletons, attribute-driven resolution, runtime parameter overrides, circular dependency detection, and PSR-11 compliance.


Features


Requirements


Installation


Quick Start


Usage

Auto-Wiring

Classes with type-hinted constructor dependencies resolve without manual configuration:

Default parameter values are used when no argument is supplied:


Bindings

Interface to Implementation

Closure Factory


Singletons & Shared Instances

Register a singleton to return the same instance on later resolutions:

Register an existing instance:


Contextual Bindings

Inject different implementations based on the consumer class:

give() also accepts a closure or a concrete instance:


Parameter Overrides

Override constructor parameters using named arguments:

Associative parameter arrays remain supported:

The previous named parameter-array form remains supported for compatibility:

Named arguments can also be used through the container returned by app():


Resolution Attributes

Use Inject when a constructor parameter needs a specific resolution target:

An ordinary Inject is a fallback after contextual and global bindings. Add Override when the injection point must take precedence over those registrations:

Runtime arguments always take precedence, including when Override is present.

Use Value for scalar constructor configuration:

Value attributes are checked against the declared parameter type. A runtime argument overrides the attribute value.

Use Singleton to share an automatically resolved concrete class:

An explicit instance(), singleton(), or transient bind() registration overrides the class attribute.

Resolution Precedence

Object dependencies use this order:

  1. Runtime argument
  2. Contextual binding
  3. Registered instance or global binding
  4. Inject
  5. Automatic concrete-class resolution
  6. Constructor default

For parameters marked with both Inject and Override, Inject moves directly below the runtime argument. Scalar parameters use runtime argument, Value, then constructor default. Lifecycle selection uses registered instance, explicit singleton, explicit transient binding, Singleton, then transient automatic resolution.


Circular Dependency Detection

Circular dependencies are detected automatically during resolution:


PSR-11 Compliance

Reflection implements Psr\Container\ContainerInterface:

PSR-11 exception classes:


Helper Function

Import the app helper function:


Testing

Run tests:

Check code style:

Format code style:

Install the PHP 8.4 static-analysis toolchain and run PHPStan:


License

MIT License. See LICENSE for details.


Author

Myke Meynell ([email protected])


All versions of reflection with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
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 mykemeynell/reflection contains the following files

Loading the files please wait ...