Download the PHP package respect/parameter without Composer

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

Respect\Parameter

Resolves function and constructor parameters from a PSR-11 container by type.

Install

Usage

Resolve arguments

For each parameter the resolver tries, in order:

  1. An explicit named argument (keyed by parameter name)
  2. An argument matching the parameter type
  3. The container, matched by type (non-builtin)
  4. The next remaining positional argument
  5. The parameter's default value
  6. null

Typed parameters are bound first (steps 1–3), so a positional object is matched by type wherever it sits and an earlier untyped parameter can't consume it; untyped parameters then take the leftover positional arguments in declaration order (step 4). A trailing variadic parameter receives a matching named argument (if any) followed by every remaining positional argument.

The result is an ordered list, so spread it straight into the call or constructor:

Type-first matching

A positional object is bound to the parameter that declares its type, wherever each sits in the list — so an untyped parameter never accidentally swallows it:

Named arguments

resolve() accepts named arguments too — keyed by parameter name, taking precedence over the container; the remaining parameters are filled by type and defaults:

Bind to the interface

Type-hint Resolver (the resolve() contract) rather than the concrete ContainerResolver to stay decoupled from the implementation:

Reflect any callable

Convert any callable form into a ReflectionFunctionAbstract:

Check accepted types

API

Method Type Description
resolve($reflection, $arguments) instance Resolve named/positional arguments + container into an ordered list<mixed>, expanding variadics
reflectCallable($callable) static Any callable to ReflectionFunctionAbstract
acceptsType($reflection, $type) static Check if any parameter accepts a type

ContainerResolver implements Resolver.

License

ISC. See LICENSE.


All versions of parameter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
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 respect/parameter contains the following files

Loading the files please wait ...