Download the PHP package norvica/invoker without Composer

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

Invoker

Latest Stable Version Checks

Invoker is a lightweight PHP library that simplifies invoking functions or methods with named parameters. It's designed to flexibly resolve missing parameters, utilizing a custom resolver mechanism to provide needed arguments dynamically.

Features

Installation

Install via Composer:

Basic Usage

Here is a quick example of invoking a simple callable:

Sure, let's add some advanced examples and explanations to your readme.md based on the dataProvider. This will show potential users the flexibility of your Invoker library.


Advanced Usage

The Invoker library can handle various types of callables including:

Here's how you can invoke these using the library:

Plain Functions

Closures

Object with __invoke Method

Object with Public Method

Class with Static Method

Variadic Arguments

The library also supports variadic arguments. Here's how you can pass an array for a variadic parameter.

Using a Resolver

You can implement your own resolvers by adhering to the Resolver interface, which has two methods: resolve() and supports().

Example: Resolving PSR-11 Container Services

Here's how you can create a simple resolver for a PSR-11 Container:

To invoke a method with this resolver:

Example: Resolving PSR-7 Requests

A resolver can be tailored for PSR-7 ServerRequest and Response objects. Here's a sample resolver for handling a ServerRequestInterface.

To use it:

Of course. Adding that section would clarify the scope and philosophy of the library. Here's how you can include it in your readme.md:

Running Tests


Project Philosophy: Lean and Simple

The primary goal of the Invoker library is to remain as lean and straightforward as possible. The focus is on providing a core utility for invoking callables with named parameters and custom resolvers.

Out of Scope

While we appreciate suggestions and pull requests, please note that specific implementations of resolvers or extra functionalities are considered out of scope for this library. We aim to keep the codebase clean and easily maintainable, without incorporating features that may lead to bloat or complexity.

If you require more specialized behaviors, you are encouraged to extend the library or implement your own resolvers according to your project needs.


Similar Concepts and Alternatives

If you're interested in this library, you might also want to explore other similar tools and frameworks that offer functionality for argument resolution or method invocation.

Symfony Action Argument Resolving

One notable alternative is Symfony's Action Argument Resolving. This feature allows you to transform the incoming request or any other data into arguments passed into your controller methods. While it's more tightly integrated with the Symfony ecosystem, it offers a wide array of built-in resolvers and the ability to create custom ones.

PHP-DI Invoker

Another mature project with very similar idea is PHP-DI Invoker. Feel free to check the project's README.


All versions of invoker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 norvica/invoker contains the following files

Loading the files please wait ....