Skip to content

Types structure compatibility - #2586

Merged
norberttech merged 4 commits into
1.xfrom
types-structure-compatibility
Aug 7, 2026
Merged

Types structure compatibility#2586
norberttech merged 4 commits into
1.xfrom
types-structure-compatibility

Conversation

@norberttech

Copy link
Copy Markdown
Member

Resolves: #xxx

Change Log


Added

  • flow-php/etl - ElementCompatibility for structure element matching
  • flow-php/etl - TypeMerge merges structures, lists and maps instead of collapsing to json
  • flow-php/types - StructureShapeInference fixture guarding type_structure() shape inference

Fixed

  • flow-php/types - string-keyed arrays infer as structures, never maps
  • flow-php/types - type equality compares optional elements and allow_extra
  • flow-php/types - assert() and cast() no longer widen the return declared by Type
  • flow-php/etl - match() accepts exactly what StructureType::isValid() accepts
  • flow-php/etl-adapter-parquet - optional structure elements are rejected instead of silently written
  • flow-php/etl-adapter-seal - optional structure elements are rejected instead of silently written
  • flow-php/etl-adapter-xml - optional structure elements are rejected instead of silently written

Changed

  • flow-php/types - a Type implementation's generic parameter is now the value it represents
  • flow-php/types - type_*() return their concrete class instead of Type, except type_from_array()
  • flow-php/types - MapType takes one generic parameter instead of two
  • flow-php/etl - conflicting structure elements widen to string, promoting numerics losslessly

Removed

Deprecated

Security

…chema matchin

- infer string-keyed arrays as structures, never maps
- compare optional elements and allow_extra in type equality
- match() now accepts exactly what StructureType::isValid() accepts
- merge structures, lists and maps instead of collapsing to json
- widen conflicting elements to string, promoting numerics losslessly
- reject optional structure elements in parquet, seal and xml writers
…dated valu

- unify implementations on `@template-covariant T` = the represented
value, deriving element/key/value with `value-of<T>` / `key-of<T>`
- return concrete classes from every `type_*` DSL function except the
polymorphic `type_from_array()`
- re-narrow `assert()`/`cast()` returns widened by implementations
- build structures through `type_structure()` instead of `new
StructureType()`
- guard `type_structure()` shape inference with StructureShapeInference
@norberttech norberttech added this to the 0.43.0 milestone Aug 7, 2026
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.29577% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.33%. Comparing base (b5819f3) to head (faaf404).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2586      +/-   ##
============================================
+ Coverage     86.29%   86.33%   +0.04%     
- Complexity    23241    23745     +504     
============================================
  Files          1819     1821       +2     
  Lines         71940    72002      +62     
============================================
+ Hits          62079    62163      +84     
+ Misses         9861     9839      -22     
Components Coverage Δ
etl 90.84% <100.00%> (+0.03%) ⬆️
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 91.73% <95.45%> (+0.14%) ⬆️
lib-parquet 70.23% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 89.82% <ø> (ø)
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% <ø> (+0.36%) ⬆️
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 89.46% <ø> (ø)
adapter-doctrine 90.75% <ø> (ø)
adapter-google-sheet 91.56% <ø> (ø)
adapter-http 75.79% <ø> (ø)
adapter-json 87.66% <ø> (ø)
adapter-logger 50.00% <ø> (ø)
adapter-parquet 88.85% <100.00%> (+0.16%) ⬆️
adapter-text 92.59% <ø> (ø)
adapter-xml 84.45% <100.00%> (+0.18%) ⬆️
adapter-avro 0.00% <ø> (ø)
adapter-excel 87.20% <ø> (ø)
adapter-postgresql 90.84% <ø> (ø)
adapter-seal 83.61% <100.00%> (+0.35%) ⬆️
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.

@norberttech
norberttech merged commit c3e6e36 into 1.x Aug 7, 2026
49 checks passed
@norberttech
norberttech deleted the types-structure-compatibility branch August 7, 2026 14:15
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Aug 7, 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