Skip to content

IResponse: add missing $sameSite parameter to setCookie()#247

Open
jelen07 wants to merge 1 commit intonette:v3.3from
jelen07:fix/iresponse-setcookie-samesite-v3.3
Open

IResponse: add missing $sameSite parameter to setCookie()#247
jelen07 wants to merge 1 commit intonette:v3.3from
jelen07:fix/iresponse-setcookie-samesite-v3.3

Conversation

@jelen07
Copy link

@jelen07 jelen07 commented Mar 12, 2026

Summary

  • The concrete Response::setCookie() already accepts ?string $sameSite as the 8th parameter, but the IResponse interface is missing it
  • This makes it impossible to set the SameSite cookie attribute when type-hinting against the interface without suppressing static analysis errors (e.g. PHPStan reports argument.unknown)
  • The fix on master (4.0) already includes this parameter — this backports it to v3.3

Diff

Single line addition: ?string $sameSite = null as the last parameter of IResponse::setCookie()

This is backwards-compatible since the parameter is optional with a null default.

- The concrete Response::setCookie() already accepts ?string $sameSite as the 8th parameter, but the IResponse interface is missing it. This makes it impossible to set the SameSite attribute when working with the interface without suppressing static analysis errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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