oneguard / expression-language-extensions
Useful extensions to Symfony Expression Language
1.0.0
2018-10-29 13:09 UTC
Requires
- php: ^7.1.3
- symfony/expression-language: ^4.1
Requires (Dev)
- phpunit/phpunit: ^7.4
- satooshi/php-coveralls: ^2.0
This package is auto-updated.
Last update: 2024-11-29 05:44:44 UTC
README
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:
Reporting an issue or a feature request
Issues and feature requests are tracked in the Github issue tracker.