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

Using custom FluentType as selector in ast::Expression::Select #366

Open
JoyceBabu opened this issue Jul 17, 2024 · 0 comments
Open

Using custom FluentType as selector in ast::Expression::Select #366

JoyceBabu opened this issue Jul 17, 2024 · 0 comments

Comments

@JoyceBabu
Copy link

I have a custom type FluentPhpZvalValue implementing FluentType for storing PHP variables. For example, boolean types are stored as a custom type, instead of converting to FluentValue::String or FluentValue::Number, since I want to retain type information when calling type PHP functions from fluent using add_function.

But the disadvantage of using a custom type is that I can no longer use the custom type in select expressions.

key = My value is { $val }. But select gives { $val ->
        [true] true
        *[false] false
    }.

The above message formatted with { "value": false } returns

My value is true. But select gives false.

ast::Expression::write currently checks only for FluentValue::String and FluentValue::Number.

Can you add support for matching FluentValue::Custom or use the string representation for the matching?

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

No branches or pull requests

1 participant