Skip to content

Prevent PHPStan reporting unknown variable passed to StructureElement - #2704

Merged
norberttech merged 2 commits into
flow-php:1.xfrom
stloyd:chore/structure-type-phpstan
Oct 23, 2026
Merged

norberttech merged 2 commits into
flow-php:1.xfrom
stloyd:chore/structure-type-phpstan

Conversation

@stloyd

@stloyd stloyd commented Oct 23, 2026

Copy link
Copy Markdown
Member

Without this PHPStan loses information about second field on StructureElement when passed with it and reports:

29     Parameter #1 $elements of function Flow\Types\DSL\type_structure
           expects array<Flow\Types\Type<string|null>|Flow\Types\Type\Logical\St
           ructureElement<string|null>>, array<string, Flow\Types\Type\Logical\S
           tructureElement<string|null, true>> given.
           🪪  argument.type

Change Log


Added

Fixed

  • Prevent PHPStan reporting unknown variable passed to `StructureElement`

Changed

Removed

Deprecated

Security

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.10%. Comparing base (78d1243) to head (3e83842).

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2704      +/-   ##
============================================
+ Coverage     89.86%   90.10%   +0.24%     
- Complexity      337    29571   +29234     
============================================
  Files          2232     2220      -12     
  Lines         86413    85881     -532     
============================================
- Hits          77658    77387     -271     
+ Misses         8755     8494     -261     
Components Coverage Δ
etl 95.90% <ø> (+0.21%) ⬆️
cli 87.13% <ø> (+0.32%) ⬆️
lib-array-dot 96.52% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 94.24% <ø> (ø)
lib-filesystem 87.63% <ø> (ø)
lib-types 94.69% <ø> (ø)
lib-parquet 82.15% <ø> (+0.20%) ⬆️
lib-parquet-viewer 83.15% <ø> (ø)
lib-snappy 89.86% <ø> (-0.89%) ⬇️
lib-dremel 0.00% <ø> (ø)
lib-postgresql 89.39% <ø> (ø)
lib-telemetry 86.85% <ø> (ø)
bridge-filesystem-async-aws 92.76% <ø> (ø)
bridge-filesystem-azure 90.34% <ø> (ø)
bridge-filesystem-sftp 91.02% <ø> (ø)
bridge-monolog-http 96.84% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 91.45% <ø> (+0.50%) ⬆️
symfony-http-foundation 75.81% <ø> (ø)
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 90.66% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.35% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.77% <ø> (ø)
adapter-chartjs 79.14% <ø> (ø)
adapter-csv 96.68% <ø> (+0.13%) ⬆️
adapter-doctrine 94.86% <ø> (+0.60%) ⬆️
adapter-google-sheet 99.20% <ø> (ø)
adapter-http 88.12% <ø> (ø)
adapter-json 90.00% <ø> (+0.96%) ⬆️
adapter-logger 44.44% <ø> (ø)
adapter-parquet 95.34% <ø> (+0.48%) ⬆️
adapter-text 96.94% <ø> (+0.76%) ⬆️
adapter-xml 94.19% <ø> (+0.19%) ⬆️
adapter-avro 7.14% <ø> (ø)
adapter-excel 97.30% <ø> (+1.07%) ⬆️
adapter-postgresql 97.48% <ø> (+8.22%) ⬆️
adapter-seal 90.86% <ø> (+3.47%) ⬆️
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.

@stloyd
stloyd enabled auto-merge (squash) October 23, 2026 13:51
@norberttech

Copy link
Copy Markdown
Member

hmm now I need to dig a bit deeper and try to understand why Mago missed it to not introduce some conflict 🤔 Looks good at first glance

@norberttech
norberttech disabled auto-merge October 23, 2026 18:02
@norberttech
norberttech merged commit 34a956c into flow-php:1.x Oct 23, 2026
21 checks passed
@stloyd
stloyd deleted the chore/structure-type-phpstan branch October 23, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants