Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BC Break] Remove conflicting expression language custom functions #142

Closed
wants to merge 1 commit into from

Conversation

ogizanagi
Copy link
Member

@ogizanagi ogizanagi commented May 19, 2022

with new 6.1 operators: https://symfony.com/blog/new-in-symfony-6-1-improved-expressionlanguage-syntax

especially the contains one which currently conflicts with the operator and produces an exception:

Symfony\Component\ExpressionLanguage\SyntaxError: Unexpected token "operator" of value "contains" around position 1 for expression contains(article.slug, "foo").

For projects that'll still want to use these function, until installing Symfony 6.1, they can extend the expression language by registering a custom expression provider tagged with stenope.expression_language_provider:

class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface
{
    public function getFunctions(): iterable
    {
        yield from [
            ExpressionFunction::fromPhp('str_contains', 'contains'),
            ExpressionFunction::fromPhp('str_starts_with', 'starts_with'),
            ExpressionFunction::fromPhp('str_ends_with', 'ends_with'),
        ];
    }
}

@ogizanagi
Copy link
Member Author

Replaced by #143

@ogizanagi ogizanagi closed this May 20, 2022
ogizanagi added a commit that referenced this pull request May 20, 2022
…ction on Sf6.1 (ogizanagi)

This PR was merged into the 0.x-dev branch.

Discussion
----------

[ExpressionLanguage] Disable test case for conflicting function on Sf6.1

with new 6.1 operators: https://symfony.com/blog/new-in-symfony-6-1-improved-expressionlanguage-syntax

Supersedes #142

Commits
-------

e9fface [ExpressionLanguage] Disable test case for conflicting function on Sf 6.1
ogizanagi added a commit that referenced this pull request May 20, 2022
This PR was squashed before being merged into the 0.x-dev branch.

Discussion
----------

[CI] Add Symfony 6.1 check

Waiting for #142 merge first

Commits
-------

920fba1 [ExpressionLanguage] Disable test case for conflicting function on Sf 6.1
42d6e7f Upgrade php-cs-fixer version
f82b502 Fix 6.1 deprecation: public and protected properties are final
7fb8d59 Fix 6.1 Serializer ContextAwareDenormalizerInterface deprecation
eceb27e Fix framework.http_method_override deprecation
f5d242b Fix decoder deprecations
8152567 [CI] Add Symfony 6.1 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant