Skip to content

fix: declare JSONEachRow output rows covariant - #351

Merged
simPod merged 1 commit into
masterfrom
fix/phpstan-native-json-format
Nov 23, 2026
Merged

simPod merged 1 commit into
masterfrom
fix/phpstan-native-json-format

Conversation

@simPod

@simPod simPod commented Nov 23, 2026

Copy link
Copy Markdown
Owner

PHPStan 2.3.7 rejects the JsonEachRow format passed to selectWithParams in the Parts snippet because the output row type is invariant.

Declare the row type covariant on the read-only JsonEachRow output and its Output interface. The output exposes rows but does not accept them, so this reflects the existing contract without changing runtime behavior.

PHPStan 2.3.7 rejects a JSONEachRow format passed to selectWithParams because the output row type is invariant. The read-only output exposes rows but does not accept them, so make the row type covariant on the output and its interface.
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.43%. Comparing base (a48ea49) to head (4b556bd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #351   +/-   ##
=======================================
  Coverage   96.43%   96.43%           
=======================================
  Files          43       43           
  Lines         953      953           
=======================================
  Hits          919      919           
  Misses         34       34           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@simPod
simPod merged commit 8b5badd into master Nov 23, 2026
18 of 19 checks passed
@simPod
simPod deleted the fix/phpstan-native-json-format branch November 23, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant