Skip to content

Typed persistent parameters #230

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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