{"id":16119972,"url":"https://github.com/uuf6429/expression-language-arrowfunc","last_synced_at":"2025-10-10T10:33:06.805Z","repository":{"id":47457697,"uuid":"72320999","full_name":"uuf6429/expression-language-arrowfunc","owner":"uuf6429","description":"➡️ Arrow function support in Symfony Expression Language","archived":false,"fork":false,"pushed_at":"2022-07-20T21:40:04.000Z","size":49,"stargazers_count":3,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-03T14:53:01.166Z","etag":null,"topics":["arrow-functions","expression-language","php","symfony","syntax","uuf6429"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uuf6429.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-30T02:43:24.000Z","updated_at":"2023-12-17T21:24:48.000Z","dependencies_parsed_at":"2022-08-21T02:40:51.423Z","dependency_job_id":null,"html_url":"https://github.com/uuf6429/expression-language-arrowfunc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/uuf6429/expression-language-arrowfunc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fexpression-language-arrowfunc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fexpression-language-arrowfunc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fexpression-language-arrowfunc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fexpression-language-arrowfunc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uuf6429","download_url":"https://codeload.github.com/uuf6429/expression-language-arrowfunc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fexpression-language-arrowfunc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003549,"owners_count":26083595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arrow-functions","expression-language","php","symfony","syntax","uuf6429"],"created_at":"2024-10-09T20:55:42.789Z","updated_at":"2025-10-10T10:33:06.790Z","avatar_url":"https://github.com/uuf6429.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony Expression Language Arrow Function\n\n[![Build Status](https://travis-ci.org/uuf6429/expression-language-arrowfunc.svg?branch=master)](https://travis-ci.org/uuf6429/expression-language-arrowfunc)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg)](https://php.net/)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/uuf6429/expression-language-arrowfunc/master/LICENSE)\n[![Coverage](https://codecov.io/gh/uuf6429/expression-language-arrowfunc/branch/master/graph/badge.svg?token=Bu2nK2Kq77)](https://codecov.io/github/uuf6429/expression-language-arrowfunc?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/uuf6429/expression-language-arrowfunc/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/uuf6429/expression-language-arrowfunc/?branch=master)\n[![Packagist](https://img.shields.io/packagist/v/uuf6429/expression-language-arrowfunc.svg)](https://packagist.org/packages/uuf6429/expression-language-arrowfunc)\n\nArrow function (aka \"Lambda Expression\" or \"Anonymous Function\") support in Symfony [Expression Language component](https://symfony.com/doc/current/components/expression_language.html).\n\n## Syntax\n```\n (a) -\u003e { a * 2 }\n  ^  ^      ^\n  |  |      '----- Function body is a single expression that can make use of passed parameters or global variables.\n  |  '------------ The lambda operator - input parameters are to the left and the output expression to the right.\n  '--------------- Comma-separated list of parameters passed to arrow function.\n```\n\n## Safety\n\nReturning callbacks can be dangerous in PHP. If the returned value is not checked, PHP may end up executing arbitrary global functions, static class methods or object methods.\n\n### Problem Example\n```php\n$language = new ExpressionLanguage();\n$expression = '(value) -\u003e { value \u003e 20 }';\n$filter = $language-\u003eevaluate($expression);\n$values = array_filter([18, 23, 40], $filter);\n```\n\nIf `$expression` returns a string or array, `array_filter()` will arbitrarily call whatever was returned.\n\n### Solution\n\nThere are two solutions:\n- Set the type declaration of methods using the callback to `Closure` (*not `Callable`!*) - prone to mistakes and quite risky.\n- The engine returns the callback wrapped in an object that cannot be invoked by default - this is the safest option (and default one).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuuf6429%2Fexpression-language-arrowfunc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuuf6429%2Fexpression-language-arrowfunc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuuf6429%2Fexpression-language-arrowfunc/lists"}