Download the PHP package uuf6429/expression-language-arrowfunc without Composer

On this page you can find all versions of the php package uuf6429/expression-language-arrowfunc. 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 expression-language-arrowfunc

➡️ Symfony Expression Language Arrow Function

for Symfony Expression Language (5-8)

CI codecov Minimum PHP Version License Latest Stable Version Latest Unstable Version

This library extends Symfony Expression Language component to support Arrow Function (also known as Lambda Functions) syntax.

🔌 Installation

Install via Composer:

💡 Before You Start

1. How does it work? Essentially, the library pre-processes expressions to replace callbacks with placeholders (variables), then generates new variables (with the callback as value), which are finally later on used for executing the expression. Conceptually:
2. What does the syntax look like? By default, the arrow function syntax looks like so:
3. How safe is it? Symfony Expression Language can be unsafe by design – if the result of expressions is used as a callable without being checked, global callables, functions and static methods could be called arbitrarily from (potentially malicious) expressions. This library acknowledges the risk and tries to mitigate it. **Problem Examples** 1. Exposing functionality that accepts a callable to Expression Language: 2. A naive implementation of arrow functions: **Solutions** There are two viable solutions: 1. Set the type declaration of methods or functions that will receive callbacks to `Closure` (*not `Callable`!*) - it works, but it is prone to mistakes and frankly, quite risky. 2. The engine wraps callbacks within an object that cannot be invoked by default – this is the safest option (and the default). Usages need to be aware of this wrapping, drastically decreasing the risk of mistakes.

🚀 Usage

Usage

Two different APIs are provided to suit your integration needs:

1. Ready-Made Drop-in Replacement If you just need a standard, drop-in replacement for Symfony's standard `ExpressionLanguage` class, use [`uuf6429\ExpressionLanguage\ExpressionLanguageWithArrowFunctions`]:
2. Extensible Trait If you want to integrate this functionality with your own custom `ExpressionLanguage` implementation or combine it with other classes, use the trait [`uuf6429\ExpressionLanguage\ArrowFunctionTrait`]:

[!IMPORTANT]

For safety reasons, any returned callbacks are wrapped in a SafeCallable object. Your methods and functions need to expect and handle that object. This is to avoid expressions being able to "break out" and execute anything.

Here's a more complete example:


All versions of expression-language-arrowfunc with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8
symfony/expression-language Version ^5.4 || ^6 || ^7 || ^8
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 uuf6429/expression-language-arrowfunc contains the following files

Loading the files please wait ...