packages/config/src/Config/Parser/JSON.php (~line 30) accepts any valid JSON, but inputs like "foo", 123, or true decode to a scalar and are returned from a method declared : array, causing a TypeError instead of the package's Parse exception.
Fix: check is_array($config) after decoding and throw Parse when the top-level value is not a config map.
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.
packages/config/src/Config/Parser/JSON.php(~line 30) accepts any valid JSON, but inputs like"foo",123, ortruedecode to a scalar and are returned from a method declared: array, causing aTypeErrorinstead of the package'sParseexception.Fix: check
is_array($config)after decoding and throwParsewhen the top-level value is not a config map.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.