Skip to content

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

@JoyceBabu

Description

@JoyceBabu

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions