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.
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 aboolproperty the parser didn't cast) lets PHP throw a rawTypeErrorinstead of the library raisingLoad.Fix: validate/cast against the expected type, or catch the assignment
TypeErrorand rethrowLoadwith 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.