Skip to content

fix(flow-php/types): structure/list/map casting no longer fabricates missing data - #2595

Merged
norberttech merged 2 commits into
1.xfrom
type-collection-casting-bug
Aug 13, 2026
Merged

fix(flow-php/types): structure/list/map casting no longer fabricates missing data#2595
norberttech merged 2 commits into
1.xfrom
type-collection-casting-bug

Conversation

@norberttech

Copy link
Copy Markdown
Member

Change Log


Added

  • flow-php/types - MissingElementCastingException naming the failing structure element via getPrevious()

Fixed

  • flow-php/types - structure cast no longer fabricates values for absent or null elements whose type rejects null
  • flow-php/types - list/map cast of null throws instead of returning an empty collection
  • flow-php/types - structures with only optional elements accept an empty payload
  • flow-php/flow-php-ext - native cast defers null non-optional elements to PHP, keeping exception parity

Changed

  • flow-php/types - JSON string payloads for structure/list/map decode and cast element-wise

Removed

Deprecated

Security

…missing data

- absent or present-null structure elements whose type rejects null
throw CastingException with MissingElementCastingException as previous,
naming the element
- list/map cast(null) throws instead of returning empty; JSON string
payloads decode and cast element-wise
- all-optional structures now accept an empty payload (array_is_list([])
rejected it)
- native extension bails to PHP cast for null non-optional elements,
keeping exception parity
@norberttech norberttech added this to the 0.44.0 milestone Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.44%. Comparing base (45626bb) to head (bb10992).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##                1.x    #2595   +/-   ##
=========================================
  Coverage     86.44%   86.44%           
- Complexity    23305    23309    +4     
=========================================
  Files          1833     1834    +1     
  Lines         72314    72331   +17     
=========================================
+ Hits          62513    62530   +17     
  Misses         9801     9801           
Components Coverage Δ
etl 91.20% <ø> (ø)
cli 89.40% <ø> (ø)
lib-array-dot 81.44% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 93.61% <ø> (ø)
lib-filesystem 86.67% <ø> (ø)
lib-types 92.26% <100.00%> (+0.13%) ⬆️
lib-parquet 70.33% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 89.38% <ø> (-0.45%) ⬇️
lib-dremel 0.00% <ø> (ø)
lib-postgresql 87.74% <ø> (ø)
lib-telemetry 86.64% <ø> (ø)
bridge-filesystem-async-aws 92.74% <ø> (ø)
bridge-filesystem-azure 90.45% <ø> (ø)
bridge-monolog-http 96.82% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 92.07% <ø> (ø)
symfony-http-foundation 78.57% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 98.95% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.11% <ø> (ø)
bridge-symfony-http-foundation-telemetry 92.85% <ø> (ø)
bridge-symfony-filesystem-bundle 91.85% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.57% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.72% <ø> (ø)
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 89.46% <ø> (ø)
adapter-doctrine 90.75% <ø> (ø)
adapter-google-sheet 91.56% <ø> (ø)
adapter-http 75.79% <ø> (ø)
adapter-json 87.65% <ø> (ø)
adapter-logger 50.00% <ø> (ø)
adapter-parquet 90.40% <ø> (ø)
adapter-text 92.59% <ø> (ø)
adapter-xml 84.45% <ø> (ø)
adapter-avro 0.00% <ø> (ø)
adapter-excel 87.20% <ø> (ø)
adapter-postgresql 90.84% <ø> (ø)
adapter-seal 83.61% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 87.36% <ø> (ø)
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added size: L and removed size: M labels Aug 13, 2026
@norberttech
norberttech merged commit 0149221 into 1.x Aug 13, 2026
46 of 48 checks passed
@norberttech
norberttech deleted the type-collection-casting-bug branch August 13, 2026 12:48
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant