Skip to content

Name the ResourceEndpoint helpers consistently - #6

Merged
loevgaard merged 1 commit into
1.xfrom
consistent-endpoint-helper-names
Aug 6, 2026
Merged

Name the ResourceEndpoint helpers consistently#6
loevgaard merged 1 commit into
1.xfrom
consistent-endpoint-helper-names

Conversation

@loevgaard

Copy link
Copy Markdown
Member

The five protected helpers mixed three naming conventions: getOne/createOne (semantic verb + One), bare update, the noun operation, and the abbreviated putSub. After this PR every helper follows one of two patterns:

  • semanticVerb + One — typed single-resource CRUD: getOne, createOne, updateOne
  • httpVerb + target — transport helpers: postOperation, putSubResource
Before After
update() updateOne()
operation() postOperation()
putSub() putSubResource()

Also fixes the class docblock's update() bullet, which said PUT while the helper sends PATCH — the same slip #4 fixed on updatePayment().

No BC impact: the helpers are protected, endpoint subclassing is explicitly unsupported (@internal, outside the BC promise), and every call site lives in PaymentsEndpoint. Behavior-neutral rename — all checks green (103 tests, PHPStan max, ECS, Rector).

The five protected helpers mixed three conventions: getOne/createOne
(semantic verb + One), bare update, the noun operation, and the
abbreviated putSub. Now every helper is either semanticVerb+One (typed
single-resource CRUD) or httpVerb+target (transport helpers):

- update       -> updateOne
- operation    -> postOperation
- putSub       -> putSubResource

Also fixes the class docblock's update() bullet, which said PUT while
the helper sends PATCH (the same slip #4 fixed on updatePayment()).

Internal-only rename: the helpers are protected, endpoint subclassing
is explicitly unsupported, and all call sites live in PaymentsEndpoint.
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.00%. Comparing base (52dd84a) to head (298b029).

Additional details and impacted files
@@            Coverage Diff            @@
##                1.x       #6   +/-   ##
=========================================
  Coverage     97.00%   97.00%           
  Complexity      146      146           
=========================================
  Files            24       24           
  Lines           401      401           
=========================================
  Hits            389      389           
  Misses           12       12           

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

@loevgaard
loevgaard merged commit 425bd28 into 1.x Aug 6, 2026
35 checks passed
@loevgaard
loevgaard deleted the consistent-endpoint-helper-names branch August 6, 2026 09:47
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