Skip to content

[CC-4239] Add SEPA-specific PHPDoc to SepaDirectDebit::setRecurring - #256

Merged
Ryouzanpaku merged 7 commits into
mainfrom
CC-4239/recurring-setter-param
Nov 26, 2026
Merged

Ryouzanpaku merged 7 commits into
mainfrom
CC-4239/recurring-setter-param

Conversation

@Ryouzanpaku

@Ryouzanpaku Ryouzanpaku commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Addresses the QA review on CC-4239 (comment 495774) against the merged PR #247 (the recurring flag feature is unreleased, part of 4.1.0).

Bug 2 (low) — missing PHPDoc: fixed (the substantive change)

SepaDirectDebit now overrides setRecurring(bool $active): self with a SEPA-specific docblock stating the caller contract — true registers the type for recurring (mandate-based) collection, false (default) for one-off, applied at type registration. (Replaces the use CanRecur { setRecurring as public; } alias.) The docblock is kept to the caller contract only; internal platform mechanics are deliberately not documented.

Bug 1 (medium) — parameter name: keeping $active, treated as a non-blocker

The parameter stays $active, consistent with the shared CanRecur::setRecurring(bool $active) used by all CanRecur types; renaming only this type would contradict the trait. A PHP parameter-name change is only breaking if the library guarantees named-argument stability, which this SDK doesn't (same stance as Symfony — param names excluded from the BC promise). So the AC's $recurring is not treated as a required change, and no name-pinning test is added. Standardising on the property name would be a trait-wide change for a future major.

Preserved (reflection-probe-verified)

use CanRecur kept → isRecurring(), deprecated activateRecurring(), and the ResourceService class_uses(CanRecur) capability gate unchanged. recurring still always exposed, default false.

Bug 3 (low, pre-existing) — deferred

null/"" recurring in a response makes the typed setter throw on fetch. Affects all CanRecur types; fix belongs in the shared trait / mapper. Not reachable via the real API. Suggested as a separate low-priority ticket.

Verification

  • Unit suite green (800 tests). Behaviour covered by setter/getter, expose, and response-mapping tests.
  • No CHANGELOG churn — the only net change vs the merged baseline is the added docblock ($active and behaviour unchanged).

🤖 Generated with Claude Code

Ryouzanpaku and others added 5 commits November 26, 2026 11:03
…EPA PHPDoc

QA (CC-4239 comment 495774) on the merged PR #247 found the public setter's
parameter is $active (inherited via `use CanRecur { setRecurring as public; }`),
not $recurring as the ticket specified. Since PHP 8 makes the parameter name
part of the public API, `->setRecurring(recurring: true)` threw
"Unknown named parameter $recurring".

Replace the trait alias with an explicit public override
`setRecurring(bool $recurring): self` on SepaDirectDebit, carrying SEPA-specific
PHPDoc (RCUR/OOFF mandate intent) — this fixes the parameter name (bug 1) and
the missing docblock (bug 2) together. `use CanRecur` is kept, so isRecurring(),
the deprecated activateRecurring() and the ResourceService class_uses(CanRecur)
capability gate are unchanged (verified by reflection probe). Added a unit test
pinning the named-argument form.

Note: 4.1.0 is unreleased, so this only shapes the setter before release — no
CHANGELOG churn.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reverts the parameter name from $recurring back to $active. With the method
already named setRecurring, `$active` reads better than the redundant
`setRecurring(recurring: true)` — a deliberate maintainer decision that
supersedes the ticket AC's suggested `$recurring`. The important BC point still
holds: the public parameter name is settled before release (4.1.0 unreleased),
so there is no future named-argument break.

The explicit public override is kept for the SEPA-specific PHPDoc (bug 2); only
the parameter name changes. Named-argument test updated to `active: true`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… call

A named-argument call (setRecurring(active: true)) reads contrived for a
single-parameter setter. Replace it with a reflection assertion on the
parameter (name `active`, type `bool`) — that pins the actual public-API
surface directly and matches the repo's existing signature-pinning idiom
(legacySignatureDataProvider).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A reflection test that hard-pins the parameter name is brittle and low-value:
PHP parameter-name stability is only a BC concern if the library promises
named-argument support, which this SDK does not (cf. Symfony excluding param
names from its BC promise / @no-named-arguments). Behaviour is already covered
by the setter/getter, expose, and response-mapping tests. The parameter stays
$active for consistency with the CanRecur trait — no test needed to enforce it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the PMP / RCUR-OOFF mandate-derivation and charge-payload internals from
the public docblock — that is internal platform behaviour an integrator should
not need to know. Keep only the caller-facing contract: true = recurring
(mandate-based) collection, false (default) = one-off, applied at type
registration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Ryouzanpaku Ryouzanpaku changed the title [CC-4239] Fix SepaDirectDebit::setRecurring parameter name + SEPA PHPDoc [CC-4239] Add SEPA-specific PHPDoc to SepaDirectDebit::setRecurring Nov 26, 2026
The parameter and return types are already declared in the typed signature
(setRecurring(bool $active): self), so the @param/@return tags add nothing.
Keep the descriptive text only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Ryouzanpaku
Ryouzanpaku marked this pull request as ready for review November 26, 2026 10:38
@Ryouzanpaku
Ryouzanpaku requested a review from a team as a code owner November 26, 2026 10:38

@Khaled-Mahmoud-Unzer Khaled-Mahmoud-Unzer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review against the bugs from CC-4239 comment 495774. I ran the CC-4239 tests in php-sdk-test-automation (offline and live sandbox) against this branch: 24 of 27 pass. The 3 failures are bugs 1 and 3 below, which are not part of this PR.

Fixed

  • Bug 2: SepaDirectDebit::setRecurring() now has its own SEPA docblock. I checked the "applied once, at type registration" part on the live sandbox: changing recurring with an update (PUT) afterwards is silently ignored and the value from registration stays, so the docblock is correct.

Not fixed

  • Bug 1: the parameter stays $active instead of $recurring. I accept keeping it, since the SDK doesn't promise stable parameter names. Two notes:
    • SepaDirectDebit now has its own method and is the only type where setRecurring() is public, so a rename here wouldn't conflict with the trait.
    • The ticket's acceptance criteria still say setRecurring(bool $recurring). Please update the AC to $active, as was done for the "always send recurring" decision.
  • Bug 3: a null or "" recurring value in a response still crashes the fetch. I agree it belongs in a separate ticket, because it affects all CanRecur types.

Also verified

  • Backward compatibility is kept: use CanRecur, isRecurring(), activateRecurring() and the ResourceService gate still work.
  • Card, Paypal and SepaDirectDebitSecured still don't send recurring.

Approving.

@Ryouzanpaku
Ryouzanpaku enabled auto-merge (squash) November 26, 2026 11:05

@sixer1182 sixer1182 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. No behaviour change: the explicit public setRecurring(bool $active): self has the same body as the trait method, and isRecurring(), activateRecurring() and the always-exposed recurring flag are untouched. Keeping $active for consistency with CanRecur is fine.

Non-blocking wording nit: "recurring (mandate-based) collection" suggests one-off collection has no mandate, which is not the case for SEPA. "recurring collection (recurring mandate)" would be exact.

@Ryouzanpaku
Ryouzanpaku merged commit c9042cf into main Nov 26, 2026
14 checks passed
@Ryouzanpaku
Ryouzanpaku deleted the CC-4239/recurring-setter-param branch November 26, 2026 11:12
@sixer1182

sixer1182 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

One follow-up to my approval: the acceptance criteria in CC-4239 still specify setRecurring(bool $recurring), while this PR deliberately keeps $active. Please update the ticket's acceptance criteria so they match what is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants