Skip to content

Commit

Permalink
Update phpdocs for better chaining
Browse files Browse the repository at this point in the history
Following the PSR-5 Proposal, chained methods should use `return $this`.
New instances should use `return static`. This way, when classes are
extended, they refer to the correct class.
  • Loading branch information
barryvdh committed Aug 1, 2014
1 parent 9d42fad commit f58ed2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RedirectResponse extends \Symfony\Component\HttpFoundation\RedirectRespons
* @param string $key
* @param string $value
* @param bool $replace
* @return \Illuminate\Http\RedirectResponse
* @return $this
*/
public function header($key, $value, $replace = true)
{
Expand Down Expand Up @@ -62,7 +62,7 @@ public function with($key, $value = null)
* Add a cookie to the response.
*
* @param \Symfony\Component\HttpFoundation\Cookie $cookie
* @return \Illuminate\Http\RedirectResponse
* @return $this
*/
public function withCookie(Cookie $cookie)
{
Expand All @@ -75,7 +75,7 @@ public function withCookie(Cookie $cookie)
* Flash an array of input to the session.
*
* @param array $input
* @return \Illuminate\Http\RedirectResponse
* @return $this
*/
public function withInput(array $input = null)
{
Expand All @@ -89,8 +89,8 @@ public function withInput(array $input = null)
/**
* Flash an array of input to the session.
*
* @param dynamic string
* @return \Illuminate\Http\RedirectResponse
* @param mixed string
* @return $this
*/
public function onlyInput()
{
Expand All @@ -113,7 +113,7 @@ public function exceptInput()
*
* @param \Illuminate\Support\Contracts\MessageProviderInterface|array $provider
* @param string $key
* @return \Illuminate\Http\RedirectResponse
* @return $this
*/
public function withErrors($provider, $key = 'default')
{
Expand Down
2 changes: 1 addition & 1 deletion Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Request extends SymfonyRequest {
/**
* Return the Request instance.
*
* @return \Illuminate\Http\Request
* @return $this
*/
public function instance()
{
Expand Down
4 changes: 2 additions & 2 deletions ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait ResponseTrait {
* @param string $key
* @param string $value
* @param bool $replace
* @return \Illuminate\Http\Response
* @return $this
*/
public function header($key, $value, $replace = true)
{
Expand All @@ -23,7 +23,7 @@ public function header($key, $value, $replace = true)
* Add a cookie to the response.
*
* @param \Symfony\Component\HttpFoundation\Cookie $cookie
* @return \Illuminate\Http\Response
* @return $this
*/
public function withCookie(Cookie $cookie)
{
Expand Down

0 comments on commit f58ed2a

Please sign in to comment.