Skip to content

[13.x] Align Mailable::cc @return with sibling fluent methods#59892

Merged
taylorotwell merged 1 commit intolaravel:13.xfrom
mosabbirrakib:fix-mailable-cc-return-docblock
Apr 28, 2026
Merged

[13.x] Align Mailable::cc @return with sibling fluent methods#59892
taylorotwell merged 1 commit intolaravel:13.xfrom
mosabbirrakib:fix-mailable-cc-return-docblock

Conversation

@mosabbirrakib
Copy link
Copy Markdown
Contributor

In Illuminate\Contracts\Mail\Mailable, every fluent setter documents @return \$this except cc(), which is the lone outlier with @return self:

public function cc($address, $name = null);   // @return self
public function bcc($address, $name = null);  // @return $this
public function to($address, $name = null);   // @return $this
public function locale($locale);              // @return $this
public function mailer($mailer);              // @return $this

The actual implementation Illuminate\Mail\Mailable::cc() already documents @return \$this and returns \$this via setAddress(). Updates the contract to match, so static analysers see the more precise type for \$mailable->cc(...)->bcc(...) chains on a typed contract reference.

PHPDoc-only change; no behavioral or runtime impact.

@taylorotwell taylorotwell merged commit 0d00add into laravel:13.x Apr 28, 2026
54 checks passed
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