Skip to content

Add Style::realName so scope names convert to tables at the SQL boundary#33

Merged
alganet merged 1 commit into
Respect:masterfrom
alganet:style-realname-boundary
Jun 27, 2026
Merged

Add Style::realName so scope names convert to tables at the SQL boundary#33
alganet merged 1 commit into
Respect:masterfrom
alganet:style-realname-boundary

Conversation

@alganet

@alganet alganet commented Jun 27, 2026

Copy link
Copy Markdown
Member

The mapper DSL used scope/method names verbatim as DB table names, forcing PHP-side code to submit to DB conventions (snake_case, plural) — the very thing Styles exist to prevent. The one identifier a Style was never consulted for was the table name.

Add Stylable::realName(scope): table, the missing symmetric partner of styledName(scope): class, completing the quadrant (styled*->PHP, real*->DB; *Name->entity, *Property->field). Standard delegates it to realProperty; remoteIdentifier and composed are now expressed through realProperty/realName so they convert their inputs too. InMemoryMapper routes table lookups through realName while keeping scope names as aliases.

Because realName is the single point of difference for pluralized tables, Plural collapses from three overrides to one (realName); class resolution, foreign keys, and junction names are now inherited from Standard unchanged.

All edits are no-ops on existing snake/plural names; scope-name flips live in the consuming projects.

The mapper DSL used scope/method names verbatim as DB table names, forcing
PHP-side code to submit to DB conventions (snake_case, plural) — the very
thing Styles exist to prevent. The one identifier a Style was never consulted
for was the table name.

Add `Stylable::realName(scope): table`, the missing symmetric partner of
`styledName(scope): class`, completing the quadrant (styled*->PHP, real*->DB;
*Name->entity, *Property->field). Standard delegates it to realProperty;
remoteIdentifier and composed are now expressed through realProperty/realName
so they convert their inputs too. InMemoryMapper routes table lookups through
realName while keeping scope names as aliases.

Because realName is the single point of difference for pluralized tables,
Plural collapses from three overrides to one (realName); class resolution,
foreign keys, and junction names are now inherited from Standard unchanged.

All edits are no-ops on existing snake/plural names; scope-name flips live in
the consuming projects.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.48%. Comparing base (6512ccc) to head (70d7fe6).

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #33      +/-   ##
============================================
- Coverage     98.51%   98.48%   -0.03%     
+ Complexity      196      194       -2     
============================================
  Files            10       10              
  Lines           404      397       -7     
============================================
- Hits            398      391       -7     
  Misses            6        6              

☔ 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.

@alganet alganet merged commit 9148d5b into Respect:master Jun 27, 2026
3 checks passed
@alganet alganet deleted the style-realname-boundary branch June 27, 2026 12:51
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.

2 participants