Skip to content

Add setHeader() method, keep withHeader() as alias#120

Merged
s2x merged 2 commits intomasterfrom
fix/withheader-rename
Apr 12, 2026
Merged

Add setHeader() method, keep withHeader() as alias#120
s2x merged 2 commits intomasterfrom
fix/withheader-rename

Conversation

@s2x
Copy link
Copy Markdown
Collaborator

@s2x s2x commented Apr 12, 2026

Summary

  • Add setHeader() method as the proper name for mutating operation
  • Keep withHeader() as deprecated alias for backward compatibility

Fixes #38

return $this;
}

public function withHeader(string $name, string $value): self
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Suggestion] The withHeader() method is described as a deprecated alias but lacks a @deprecated PHPDoc annotation. Without it, IDEs and static analysis tools won't warn users to migrate to setHeader().

Suggested change
public function withHeader(string $name, string $value): self
/**
* @deprecated Use setHeader() instead. This method is kept for backward compatibility.
*/
public function withHeader(string $name, string $value): self

— coder-model via Qwen Code /review

@s2x s2x merged commit 512c7f7 into master Apr 12, 2026
21 checks passed
@s2x s2x deleted the fix/withheader-rename branch April 12, 2026 11:27
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.

Request::withHeader() — Mutates Object Instead of Creating New One

1 participant