8000 tweak the status method.: · code4pub/laravel@b65fa70 · GitHub
[go: up one dir, main page]

Skip to content

Commit b65fa70

Browse files
committed
tweak the status method.:
1 parent f1feb46 commit b65fa70

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

laravel/response.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ protected function cookies()
243243

244244
// All of the cookies for the response are actually stored on the
245245
// Cookie class until we're ready to send the response back to
246-
// the browser. This allows a cookies to be set easily.
246+
// the browser. This allows our cookies to be set easily.
247247
foreach (Cookie::$jar as $name => $cookie)
248248
{
249249
$config = array_values($cookie);
@@ -277,16 +277,23 @@ public function headers()
277277
}
278278

279279
/**
280-
* Set the response status code.
280+
* Get / set the response status code.
281281
*
282-
* @param int $status
283-
* @return Response
282+
* @param int $status
283+
* @return mixed
284284
*/
285-
public function status($status)
285+
public function status($status = null)
286286
{
287-
$this->foundation->setStatusCode($status);
287+
if (is_null($status))
288+
{
289+
return $this->foundation->getStatusCode();
290+
}
291+
else
292+
{
293+
$this->foundation->setStatusCode($status);
288294

289-
return $this;
295+
return $this;
296+
}
290297
}
291298

292299
}

0 commit comments

Comments
 (0)
0