Skip to content

Typed persistent parameters #230

@jtojnar

Description

@jtojnar

Currently, the components’ persistent parameters are only converted to a type when they have default value:

$type = gettype($meta['def']);
if (!$reflection->convertType($params[$name], $type)) {

Sometimes, the value can only be set dynamically but we would still like for it to be properly converted in loadState.

I propose recognizing typed annotations like @var int @persistent

It would need to be extracted here and then handled in the function above.

I can implement this if you agree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions