Skip to content

[ExpressionLanguage] Allow passing any iterable as $providers list #57685

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

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Jul 9, 2024

Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

This would make it possible to register expression function providers using tagged iterators:

my.expression_lang:
    class: Symfony\Component\ExpressionLanguage\ExpressionLanguage
    arguments:
        $providers: !tagged_iterator my.tag

Comment on lines 146 to 148
$this->assertEquals('foo', $expressionLanguage->evaluate('identity("foo")'));
$this->assertEquals('"foo"', $expressionLanguage->compile('identity("foo")'));
$this->assertEquals('FOO', $expressionLanguage->evaluate('strtoupper("foo")'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while on it, can we use assertSame here and in other places of the test class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have time to respond yesterday, but I see it's been taken care of in #57693

@nicolas-grekas
Copy link
Member

Thank you @HypeMC.

@nicolas-grekas nicolas-grekas merged commit 2611029 into symfony:7.2 Jul 9, 2024
8 of 10 checks passed
@HypeMC HypeMC deleted the iterable-providers branch July 9, 2024 09:31
@fabpot fabpot mentioned this pull request Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants