You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to restrict one binary operator from Symfony expression language (for example: .. double dot operator). All binary operators are defined in Symfony\Component\ExpressionLanguage\Parser.
So I came to conclusion that I need somehow to redefine $this->binaryOperators in Parser.
That Parser is used later in Symfony\Component\ExpressionLanguage\ExpressionLanguage. But unfortunately, it is not possible to override ExpressionLanguage class to make it use another custom Parser in any way (except of just creating own class by copying 99% of ExpressionLanguage class), because of this piece of code:
private function getParser()
{
if (null === $this->parser) {
$this->parser = new Parser($this->functions);
}
return $this->parser;
}
May I kindly ask SF developers to adjust this class: make this function protected or make it possible to use Parser injection from constructor?
Thanks!
The text was updated successfully, but these errors were encountered:
The ExpressionLanguage component is not meant to provide an extendable parser to build your own languages. This is not the goal of the component. There is already dedicated libraries targetting such goal.
Hello!
I need to restrict one binary operator from Symfony expression language (for example: .. double dot operator). All binary operators are defined in
Symfony\Component\ExpressionLanguage\Parser
.So I came to conclusion that I need somehow to redefine $this->binaryOperators in Parser.
That Parser is used later in
Symfony\Component\ExpressionLanguage\ExpressionLanguage
. But unfortunately, it is not possible to override ExpressionLanguage class to make it use another custom Parser in any way (except of just creating own class by copying 99% of ExpressionLanguage class), because of this piece of code:May I kindly ask SF developers to adjust this class: make this function protected or make it possible to use Parser injection from constructor?
Thanks!
The text was updated successfully, but these errors were encountered: