Skip to content

Add RowPrototypeResultSet; migrate RowGateway to populate() - #164

Merged
tyrsson merged 5 commits into
0.6.xfrom
resultset-row-prototype
Aug 24, 2026
Merged

Add RowPrototypeResultSet; migrate RowGateway to populate()#164
tyrsson merged 5 commits into
0.6.xfrom
resultset-row-prototype

Conversation

@tyrsson

@tyrsson tyrsson commented Aug 7, 2026

Copy link
Copy Markdown
Member
  • New RowPrototypeResultSet/RowPrototypeResultSetInterface: dedicated,
    ArrayObject-free ResultSet implementation for RowPrototypeInterface
    prototypes (e.g. RowGateway)
  • Rename RowPrototypeInterface::exchangeArray() to populate(), returning
    RowPrototypeInterface. Avoids the ArrayObject-associated vocabulary
    bleeding across the ArrayObjectResultSet/RowPrototypeResultSet split;
    whether population is mutating or returns a new instance is left as an
    implementation detail of the prototype, not the ResultSet
  • AbstractRowGateway::populate() return type widened to static to satisfy
    RowGatewayInterface's new populate() contract (behavior unchanged, it
    already returned $this)
  • RowGatewayFeature migrated from ResultSet (now ArrayObject-only) to
    RowPrototypeResultSet, calling setRowPrototype() directly

Stack created with GitHub Stacks CLIGive Feedback 💬

- Trim ResultSetInterface down to Iterator/Countable/initialize/getFieldCount/toArray
- Add standalone ArrayObjectResultSetInterface and HydratingResultSetInterface
  capability interfaces (combined via implements + intersection types, not
  inheritance), so setRowPrototype()/getRowPrototype() no longer force a wide
  ArrayObject|RowPrototypeInterface union onto every implementation
- ResultSet narrows to ArrayObject-only; HydratingResultSet keeps its
  intentionally wide object typing, now isolated to its own interface
- Move toArray() out of AbstractResultSet; each concrete class implements only
  the row-casting logic it actually needs
Dedicated ResultSet implementation for plain-array rows, decoupled from
ArrayObjectResultSetInterface's row-prototype capability entirely.
- New RowPrototypeResultSet/RowPrototypeResultSetInterface: dedicated,
  ArrayObject-free ResultSet implementation for RowPrototypeInterface
  prototypes (e.g. RowGateway)
- Rename RowPrototypeInterface::exchangeArray() to populate(), returning
  RowPrototypeInterface. Avoids the ArrayObject-associated vocabulary
  bleeding across the ArrayObjectResultSet/RowPrototypeResultSet split;
  whether population is mutating or returns a new instance is left as an
  implementation detail of the prototype, not the ResultSet
- AbstractRowGateway::populate() return type widened to static to satisfy
  RowGatewayInterface's new populate() contract (behavior unchanged, it
  already returned $this)
- RowGatewayFeature migrated from ResultSet (now ArrayObject-only) to
  RowPrototypeResultSet, calling setRowPrototype() directly
@tyrsson
tyrsson force-pushed the resultset-row-prototype branch from 0f15f70 to 075961e Compare August 24, 2026 00:44
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tyrsson
tyrsson changed the base branch from resultset-array-resultset to 0.6.x August 24, 2026 00:58
@tyrsson
tyrsson marked this pull request as ready for review August 24, 2026 00:58
@tyrsson
tyrsson merged commit b57f549 into 0.6.x Aug 24, 2026
29 checks passed
@tyrsson tyrsson added enhancement New feature or request qa Improvements in quality assurance of the project next minor Target next minor release. labels Aug 24, 2026
@tyrsson tyrsson added this to the 0.6.0 milestone Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request next minor Target next minor release. qa Improvements in quality assurance of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants