Skip to content

config: loaded value not checked against property type (raw TypeError instead of Load) #27

Description

@loks0n

The loader reflects the target property type (packages/config/src/Config/Config.php ~line 62) but never checks the loaded value against it before $instance->$propertyName = $value. A loose/mismatched validator (e.g. a boolean validator that accepts strings for a bool property the parser didn't cast) lets PHP throw a raw TypeError instead of the library raising Load.

Fix: validate/cast against the expected type, or catch the assignment TypeError and rethrow Load with the key context.

Surfaced by Greptile on #25 (config absorption). Pre-existing in the upstream library; filed as follow-up rather than fixed in the absorption PR to keep that change faithful to upstream behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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