Skip to content

OneGuardSolutions/expression-language-extensions

Repository files navigation

Symfony Expression Language Extensions

Build Status Coverage Status Maintainability GitHub license Packagist Packagist PHP from Packagist

Installation

Add it to your list of Composer dependencies:

composer require oneguard/expression-language-extensions

Usage

Create ExpressionFunction from static function:

use OneGuard\ExpressionLanguageExtensions\Utils\FunctionGenerator;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;

$function = FunctionGenerator::fromStaticFunction(Yaml::class, 'parse', 'yaml_parse');

$expressionLanguage = new ExpressionLanguage();
$expressionLanguage->addFunction($function);

$expressionLanguage->evaluate("yaml_parse('a: [1, 2]')");

License

This bundle is under the MIT license. See the complete license attached with the source code:

LICENSE

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.

About

Useful extensions to Symfony Expression Language

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages